# Drupal7 Optimizing 優化速度

使用模組 chained\_fast apcu registry\_autoload xautoload

```
drush en chained_fast apcu registry_autoload xautoload expire -y
```

```
vi sites/default/settings.php
```

```
$conf['cache_backends'][] = 'sites/all/modules/apcu/apcu.cache.inc';
$conf['cache_backends'][] = 'sites/all/modules/chained_fast/chained_fast.cache.inc';

// Chained fast configuration.
$conf['chained_fast']['fast_backend'] = 'DrupalAPCuCache';

// Cache class configuration - This uses chained_fast for all caches except the form cache. This might not be suitable for all sites, but is a good default.
$conf['cache_default_class'] = 'ChainedFastBackend';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
```

admin/config/development/performance 下列全打勾

匿名使用者頁面快取  
區塊快取  
壓縮快取頁面  
整合並壓縮 CSS 檔案  
整合並壓縮 JavaScript 檔案  
Self-updating APCu classmap (\*) (Running and available)  
APC (Running and available)  
APCu (Running and available)  
XCache (Not currently available)  
Self-updating database classmap (\*) (Running and available)  
Postpone registration of module namespaces until the first cache miss (recommended)  
Replace core class loader.

expire (Cache Expiration) 這個模組主要在控管內容更新後會清除快取  
Status of implementation 勾選 Internal expiration  
Modules that support external expiration 勾選 Include base URL in expires  
Node expiration Node actions 全勾選  
PS. 重要文章更新後，最好再用未登入的瀏覽器確認一次，如果內容仍然無法更新，就直接清除Drupal全站快取囉