Cache Settings
Choose the default cache settings used to speed up websites.
Where to find it: Sign in as root, open Server > Configuration > Nginx Settings or Apache Settings, then find the Server Cache section.
Available to: Root only.
What this page does
Use Cache Settings to control cache status, profiles, TTL, exclusions, testing, purging, warming, and domain-specific cache behavior without caching private customer traffic.
Before you start
Cache Settings can affect server-wide or multi-account behavior. Review the current state, expected service impact, and rollback path before applying a change.
How to use it
- Open the cache section for the web server that serves your websites.
- Choose the default cache options and expiry times.
- Apply the settings and test caching on an affected website.
Available settings
These are the settings offered by the current SHM page. Defaults describe the baseline for an unset value; your saved configuration may differ. Review the effect and capacity of the server before changing a value.
Nginx Microcache (Dynamic)
Controls the per-domain microcache snippet used by Nginx for dynamic requests.
| Setting | Values and baseline | Purpose and when to change it |
|---|---|---|
Dynamic cache TTL (proxy_cache_valid)nginx_dynamic_ttl | Time with a unit, for example 30s or 5m; range 60–2592000 seconds Baseline: 900s | How long Nginx should cache successful anonymous dynamic responses (HTTP 200/301/302). Use 5m-30d depending on content freshness. The default is 900 seconds; individual vhosts can override it from Cache Manager. |
Static cache TTL (proxy_cache_valid)nginx_static_ttl | Time with a unit, for example 30s or 5m; range 60–2592000 seconds Baseline: 1d | Controls server-side retention for CSS, JavaScript and fonts, and browser freshness for public static responses, including images. Images are not stored in the server-side disk cache. Keep 1d for normal profiles. Static Only inherits this root default unless a per-vhost override is saved, and both accept values up to 30d. |
Cache keys zone RAM (keys_zone)nginx_cache_keys_zone_size | Size, for example 128k or 64m Baseline: 128k | Shared-memory size for each Nginx proxy_cache keys zone. This is RAM, not disk, and each cached vhost can create separate dynamic/static zones. Default 128k balances useful per-site key capacity with aggregate shared-hosting RAM. Raise it only for unusually large individual sites; valid range is 32k-128m. |
Cache disk max per zone (max_size)nginx_cache_max_size | Size, for example 128k or 64m; range 64–102400 Baseline: 64m | Disk limit for each Nginx dynamic/static cache zone. When the zone reaches this size, Nginx evicts older cache files. Default 64m bounds aggregate disk exposure on high-cardinality shared hosts. Raise it only when disk capacity and inode usage are monitored. |
Static asset access lognginx_static_access_log | on / off Baseline: off | Controls access logging for static request locations by default. Per-domain Cache Manager settings can override this. Keep off to reduce access-log I/O for CSS, JavaScript, fonts and images. This setting controls logging only; image responses are not stored in the server-side disk cache. |
Cache redirects (301/302)nginx_cache_redirects | on / off Baseline: on | When enabled, Nginx also microcaches redirect responses (301/302) for the dynamic zone. Keep on unless you have frequently-changing redirect logic that must not be cached. |
Separate device cache bucketnginx_mobile_bucket | on / off Baseline: on | When enabled, Nginx uses a separate cache key bucket for mobile, tablet, and TV user agents to reduce layout mix-ups. Keep on for sites with different desktop and non-desktop markup. |
Cache lock (proxy_cache_lock)nginx_lock | on / off Baseline: on | Reduces thundering herd by allowing only one request to populate a cache key while others wait. Keep on for shared hosting and high concurrency. |
Background update (proxy_cache_background_update)nginx_background_update | on / off Baseline: on | Allows one request to refresh an expired cache item while other requests may continue using stale content. Keep on to reduce spikes on cache expiry. |
Revalidate (proxy_cache_revalidate)nginx_revalidate | on / off Baseline: on | Revalidates cached responses with upstream when possible (ETag/Last-Modified), reducing full regenerations. Keep on for better cache freshness when upstream supports it. |
Serve stale cache on upstream failures (proxy_cache_use_stale)nginx_use_stale | off, error, timeout, invalid_header, updating, http_429, http_500, http_502, http_503, http_504 Baseline: error timeout invalid_header updating http_429 http_500 http_502 http_503 http_504 | Controls when Nginx is allowed to serve stale cached content instead of an error during upstream issues. Keep the default list. Set to "off" if you prefer errors over stale responses. |
Apache Microcache (Dynamic)
Controls the per-domain microcache snippet used by Apache (disk cache) when serving vhosts directly.
| Setting | Values and baseline | Purpose and when to change it |
|---|---|---|
Quick handler (CacheQuickHandler)apache_quick_handler | on / off Baseline: off | When enabled, Apache may serve cached responses earlier in the request processing pipeline. Keep off for compatibility unless you have a specific performance reason and have tested behavior. |
Cache lock (CacheLock)apache_lock | on / off Baseline: on | Controls whether Apache uses a cache lock to reduce thundering herd during cache fills. Keep on. |
Cache TTL (seconds)apache_ttl_seconds | int; range 60–2592000 Baseline: 900 | How long Apache should cache anonymous dynamic responses server-side. Use 60-2592000 seconds. The default is 900 seconds. |
Cache directory levels (CacheDirLevels)apache_dir_levels | int; range 1–4 Baseline: 2 | Number of subdirectory levels used by Apache disk cache storage. Keep the default unless you have a very large cache directory and need better filesystem distribution. |
Cache directory length (CacheDirLength)apache_dir_length | int; range 1–3 Baseline: 1 | Number of characters used to create each cache subdirectory name. Keep the default for most setups. |
Cache lock max age (seconds)apache_lock_max_age | int; range 1–60 Baseline: 5 | Maximum time a cache lock can be held while generating a cached item. Keep low to avoid lock contention on slow backends. |
Debug cache headersapache_debug_headers | on / off Baseline: on | Adds cache debug headers to responses (HIT/MISS style headers) for troubleshooting. Enable for troubleshooting. Disable if you do not want cache details visible to clients. |
Serve stale on backend errorsapache_stale_on_error | on / off Baseline: on | Allows serving stale cached content when backend errors occur. Keep on to improve resilience during backend instability. |
Ignore missing Last-Modified (CacheIgnoreNoLastMod)apache_ignore_no_last_mod | on / off Baseline: on | Allows Apache to cache anonymous PHP/WordPress pages that do not emit Last-Modified or ETag validators. Keep on for effective server-side dynamic caching. Every profile still preserves private/no-store/no-cache, Set-Cookie, authorization, unsafe-method, and sensitive-path safeguards. |
Which sites use these defaults
The Nginx and Apache settings apply to their respective public web-server stacks. In Nginx + Apache mode, Nginx serves the public cache; in Apache standalone mode, Apache owns it. A saved per-domain value in Cache Manager takes precedence over the corresponding global default.
Use Manage account defaults for automatic cache activation on newly created accounts and child domains. Changing that account creation default does not turn caching on for existing accounts. Use Save & Apply for the web server settings and test an affected site afterwards.
Theme color