Content Caching
Content caching allows an HTTP proxy to store responses from your backend and serve cached content to subsequent requests. This can reduce backend load and improve response times for cacheable content, such as images, stylesheets, and scripts.
How Content Caching Works
Caching is configured for the whole HTTP proxy. When enabled, the proxy uses your backend's response headers to decide which responses can be cached.
The Cache-Control header controls whether content can be cached and how long
it remains fresh. Responses without a Cache-Control header that allows caching
are not cached. Enabling caching does not force all responses to be cached.
For example, a backend can allow public content to be cached for five minutes by returning:
Cache-Control: public, max-age=300
Configure these headers on your backend. Use appropriate cache directives for each resource, and ensure that private or user-specific responses are not made publicly cacheable.
Review your backend's cache headers before enabling caching. Content containing
personal information, account details, or other sensitive data must not be shared
between users. Use Cache-Control: no-store for responses that must not be stored
in a cache.
Enable Content Caching
- Open the HTTP proxy configuration in the Threat Protection portal.
- In the General Settings tab, scroll down to Cache Control.
- Turn on Enable cache.
- Apply your changes and wait for the configuration to finish deploying.
Once enabled, caching applies across the proxy wherever the backend's response headers allow it. The backend remains responsible for defining the cache policy for individual resources.
Clear Cached Content
Clear the cache when content on your backend has changed and you need to remove the previously cached version before it expires.
- Open the deployed HTTP proxy configuration.
- Under Cache Control, click Clear Cache.
- Confirm by clicking Yes, clear cache.
- Wait for the Cache cleared notification.
Clearing the cache removes cached content for the entire proxy, not an individual URL. It does not disable caching. Subsequent requests can populate the cache again according to your backend's response headers.
The clear operation is applied through a configuration rollout and is not instantaneous. Wait for it to complete before checking that updated content is being served. Your backend may receive more requests while the cache is being populated again.
Clear Cache is available after caching has been enabled and saved. The proxy must be deployed, and you must have permission to modify it. The button is disabled while a clear operation is in progress.
Clearing the proxy cache does not clear content already stored in a visitor's browser or in other caches outside the proxy.
Disable Content Caching
- Open the HTTP proxy configuration.
- Under Cache Control, turn off Enable cache.
- Apply your changes and wait for the configuration to finish deploying.
The proxy will no longer use content caching once the change has been deployed.
Troubleshooting
| Symptom | What to check |
|---|---|
| Content is not being cached | Confirm that caching is enabled and deployed, and that your backend returns a Cache-Control header that allows caching. |
| Old content is still being served | Clear the proxy cache and wait for completion. Also check the backend response and any browser or other upstream caches. |
| Clear Cache is unavailable | Confirm that caching has been saved as enabled, the proxy is deployed, and you have write permission. Wait for any ongoing clear operation to finish. |
| Failed to clear cache is displayed | Retry the operation. If it continues to fail, contact support. |