Advanced Cache Settings
Advanced settings allow you to fine-tune the caching rules for your content. These settings affect how overall content gets cached. You can select none, a few, or all of them. They’re independent.
- Ignore Query Strings
- Does your site’s content vary depending on the query string? If
not, then you can add additional optimization to your performance by
ignoring the query string in the URL request.
For example, assume that these two images are the same:
Ignore Query Strings is disabled by default. If left disabled, Akamai treats the two images as different and caches them separately. However, if you enable this option, they’re treated as the same and cached together. This results in higher cache rates, better performance, and increased origin server offload. When selecting this option, ensure that query strings do not change the object served. Otherwise, Akamai may serve the wrong object to the end user.
- Honor Origin Cache-Control Headers
- Cache-Control headers specify directives for caching mechanisms
along the request/response chain. This option controls whether you want
those headers to override some of the Akamai servers configuration.
For example, assume you have content with cache-control headers. If this option is disabled, Akamai uses the cache TTL that you specified in the cache path matches of your Akamai configuration, instead of the cache-control headers.
If you enable this option, the cache-control headers take precedence unless your Akamai configuration specifies don’t cache. Specifying don’t cache in your Akamai configuration always takes precedence over this option.
- Honor Origin Expires Headers
- Expires headers are just another way to specify cache control
such as when to refresh cacheable content. As your cached content expires,
Akamai servers check back with your
origin server for updated content.
Expires headers work the same as cache-control headers. If you enable this option, the expires headers take precedence unless your Akamai configuration specifies don’t cache. Specifying don’t cache in your Akamai configuration always takes precedence over this option. If you have both cache-control and expires headers, then the cache-control headers take precedence over the expires headers.
- Allow Caching 302s without Cache Headers
- By default, Akamai edge servers cache 302 responses only if they contain a cache-control or expires header. If this option is enabled, Akamai can cache 302s that don’t have those headers. When a 302 response is cached, it uses the same TTL that would have applied to a 200 response.
Content Revalidation Behavior
In the case where the origin is unavailable and the cache TTL is expired, you can choose to serve either stale content or an error until the origin is available to validate.
- Server stale if origin isn't available to revalidate By default, if the origin can’t be reached, the stale content (older than the edge cache TTL) will be served.
- Serve error if origin isn't available to revalidate Select this behavior to serve an error until the origin is reached. More advanced options are available in Property Manager.
Cache HTTP Error Responses
You can cache error responses from the origin to reduce calls when content is unavailable. By default, error responses with status codes 204, 305, 404, and 405 are cached for 10 seconds. You can modify the caching time (seconds, minutes, hours, or days) of this feature. On the other hand, if you update the response to a 200, it might take longer for the 200 response to appear for your end users.
Browser Caching Option
You can also choose to let your origin web server decide how to handle browser caching. This will pass the HTTP header browser caching directives from your web server unchanged through Akamai servers and down to the browser.
Browser Cache TTL
If you allow browser caching, select one of the rules for the TTL.
- Smaller Value Origin Header or Remaining Edge TTL Content will never be older than the value in the edge cache. This rule is suggested.
- Fixed Value Specify a browser cache TTL. This value could sum with the edge cache TTL, potentially increasing the total browser cache TTL.
Now, let's preview and test your site before you go live.