Cache Settings
With Cache Settings for Edge Application, you can edit cache configurations for static and dynamic content.
Implementation
Scope | Resource |
---|---|
Edge Application first steps | First steps |
Edge Cache module | Edge Cache |
Tiered Cache module | Tiered Cache |
Creating a cache setting | How to configure cache policies for Edge Application |
Configuring Advanced Cache Key | How to configure Advanced Cache Key for Edge Application |
Browser Cache Settings
Browser Cache Settings configures the amount of time that content is cached in the user’s browser. You can select from the following options:
- Honor Origin Cache Headers: honors the cache definitions sent by your origin servers through HTTP headers (
Cache-Control
andExpires
), sending the same headers to the web browser. - Override Cache Settings: overrides the cache of your origin server and allows you to set the cache time-to-live (TTL) manually.
CDN Cache Settings
CDN Cache Settings configures how Azion caches the content at the edge. You can select from the following options:
- Honor Origin Cache Headers: maintains the cache definitions sent by your origin servers through HTTP headers (Cache-Control and Expires), sending the same headers to the web browser.
- Override Cache Settings: overrides the cache setting of your origin server with the desired TTL. To set the TTL of CDN cache to values under 60 seconds, you must enable the Application Accelerator module.
Large File Optimization
Large File Optimization works with a default fragment size of 1024 kB. If you want to modify the fragmentation range, contact the Sales team.
Go to Large File Optimization documentationLarge File Optimization can be applied to both the edge cache layer and the tiered cache layer, provided that Tiered Cache is an active module.
Go to Tiered Cache documentationAdvanced Cache Key
You can use Advanced Cache Key to customize cache rules based on the following metadata:
- Cookies
- Query strings
Cache by Query String
At Azion, you define how you want the content to be cached according to Query String variations in your URLs:
-
Content does not vary by Query String (Improves Caching): defines that the cache key must ignore the query string. That is, two URLs that are different just by the variation of the query string will be considered as the same cached object.
- For example,
http://yourdomain.com/path?queryA
andhttp://yourdomain.com/path?queryB
will deliver the same cache content to your users.
- For example,
-
Content varies by some Query String fields (Whitelist): you can list which query string fields should be considered to differentiate between objects in the Azion cache. All other fields will be ignored.
- For example, if you list the
city
field, the URLshttp://yourdomain.com/path?city=A&name=X
andhttp://yourdomain.com/path?city=A&name=Y
will be considered as a single object in cache, while URLshttp://yourdomain.com/path?city=A&name=X
andhttp://yourdomain.com/path?city=B&name=X
will be considered as different objects.
- For example, if you list the
-
Content varies by Query String, except for some fields (Blocklist): you can list which fields in the query string should be ignored when differentiating cached objects. All other fields will be considered.
- For example, if you list the
random
field, the URLshttp://yourdomain.com/path?city=A&random=123
andhttp://yourdomain.com/path?city=B&random=123
will be considered different object in cache, whilehttp://yourdomain.com/path?city=A&random=123
andhttp://yourdomain.com/path?city=A&random=456
will be considered as the same object in cache.
- For example, if you list the
-
Content varies by all Query String fields: defines that the cache key must consider all fields of the query string. That is, two URLs distinct by the variation of the query string will be considered as two distinct objects in the cache.
- For example,
http://yourdomain.com/path?queryA
andhttp://yourdomain.com/path?queryB
will be stored as separate objects in the Azion cache.
- For example,
In order to increase caching efficiency, you can enable the Query String Sort option. If activated, it orders all the fields of the query string, making the position of the fields irrelevant in the definition of the cache key. If the position of the fields is relevant to differentiate your content, you should disable this option.
Cache by Cookie
You can also distinguish objects in the Azion cache by name/value of cookies.
-
Content does not vary by Cookies (Improves Caching): differentiates objects in Azion’s cache through URL; doesn’t take cookies into account.
-
Content varies by some Cookies (Allowed Rules): you can list the name of the cookies that your application uses to differentiate cached objects. All other cookies will be ignored, allowing you to segment your content by user profiles and other settings. This is the most recommended option if you use cookies to manage user sessions.
-
Content varies by Cookies, with the exception of a few (Blocklist): you can list the name of the cookies you want to ignore in the cache key setting, considering all cookies except those listed.
-
Content varies by all Cookies: in addition to the URL, it considers all cookies to differentiate objects in Azion’s cache.
Caching HTTP Methods
You can enable the Enable caching for POST switch, allowing Azion to cache POST
requests; the Enable caching for OPTIONS key allows Azion to cache OPTIONS
requests. These two cache options require the request body to be part of the cache key.
Stale Cache
With the Edge Cache module, you can enable Stale Cache to serve stale content when there’s a problem with your origin servers.
Go to stale cache documentationAdaptive Delivery
With the Edge Cache module, you can select a device group for Adaptive Delivery.
When choosing the option Content varies by some Device Groups (Whitelist), you’re allowing Azion to keep device-based variations of its objects in cache.
Go to Device Groups documentation