Edge Caching
Edge Caching is an Edge Application module that reduces latency and enables a high transfer rate for your applications through Azion’s global network of edge nodes.
1. How it works
Edge Caching is a standard module available for all Edge Applications on Azion, ensuring performance and low latency. It’s comprised of a reverse proxy architecture, through which your users connect to the edge nodes of our highly distributed global network. Edge Caching can cache your content and further extend its versatility with the L2 Caching add-on.
When a user requests content on the internet, their browser or application initiates the DNS resolution process in order to translate the requested domain into an IP address. When using Azion, you point your web application’s DNS to an address generated when creating a Domain on Azion.
Azion selects the Edge Node closest to the user by using its Software-Defined Networking (SDN) Router, reducing latency and increasing the speed of content transfer.
2. Cache Settings
This service is responsible for creating cache configurations, containing several features that expand the way content is delivered.
Cache Settings works with two versions:
- The first version focuses on static content. Thus, you don’t need to have the Application Acceleration service enabled.
- The second version, which employs Edge Caching, extends numerous configuration options in the Cache Settings interface.
Check out the guide on How to configure cache policies for Edge Application to create a custom cache setting.
2.1. Browser Cache Settings
The Browser Cache Settings configures the amount of time that content is cached in the user’s browser. You can set the Edge Application to:
Honor Origin Cache Headers | Override Cache Settings |
---|---|
This feature honors the cache definitions sent by your origin servers through HTTP headers (Cache-Control and Expires), sending the same headers to the web browser. | This feature overrides the cache of your origin server and allows you to set the cache time-to-live (TTL) manually. |
2.2. CDN Cache Settings
CDN Cache Settings is the amount of time Azion’s Edge Applications take to cache the content. You can set the Edge Application to:
Honor Origin Cache Headers | Override Cache Settings |
---|---|
This feature honors the cache definitions sent by your origin servers through HTTP headers (Cache-Control and Expires), sending the same headers to the web browser. | This feature overrides the cache of your origin server by setting the TTL manually. To set the TTL of CDN cache to values under 60 seconds, you must enable the Application Acceleration module. |
Important: when TTL for CDN cache values is lower than 10 seconds, there is a possibility of that your application will experience recurring cache misses. This can happen when the origin servers are delayed in responding, such as during maintenance periods. In such situations, Azion recommends that you apply the Bypass Cache behavior to your application or set a TTL value greater than 10 to accommodate CDN connection bursts to slower origin servers.
3. L2 Caching
This functionality is only be available if the service has been activated in your account. To activate L2 Caching, contact our Sales team.
L2 Caching is an additional layer of caching between Azion’s edge and its origin that helps to further reduce the load on your infrastructure.
When accessing your applications on Azion, your user accesses our highly distributed network capable of edge caching. By enabling L2 Caching in your edge applications, you have a second cache layer that will be responsible for feeding the edge, keeping your content cached for as long as you wish.
When using L2 Caching as an additional caching layer, you must include a configuration per region. For example: sa-brazil
for Brazil, na-united-states
for USA, etc., depending on the region.
L2 Caching was specially designed for objects that can remain in cache for a long period of time. Thus, you can only activate it on cache policies with a TTL equal to or greater than 3 seconds, with the default TTL equal to 60 seconds.
The L2 Caching module currently doesn’t support bypass cache. You can configure a Bypass Cache rule for caching at Azion, but applications with active L2 cache settings will continue to keep caching in that layer for the specified TTL.
Whenever necessary, you can use Real-Time Purge to expire your L2 Caching content before the expected TTL time. Remember to purge first in L2 and only later in Edge Caching. This avoids edge feedback with outdated L2 content.
Warning: the Honor Origin setting isn’t available for CDN Cache. You need to set a TTL to overwrite the CDN cache.
To use the L2 Caching module, proceed as follows:
- Access Real-Time Manager (RTM).
- On the upper-left corner, select the Products menu > Edge Application.
- Select the Edge Application in which you want to use the module.
- Select the Main Settings tab, if it isn’t already selected.
- At the end of the Edge Application Modules section, enable the L2 Caching switch.
- Select the Cache Settings tab.
- To manage the L2 Caching layer settings, click the Add Cache Settings button to create a new cache settings, or select one of the existing ones from the Cache Settings List to edit it.
- Set the Default TTL (seconds) field to a value greater than or equal to 3 seconds.
- Enable the L2 Caching button.
- Click the Save button to save your configuration.
4. Slice Settings
Slice is a feature for Edge Applications that processes large amounts of data more effectively, reducing latency and saving bandwidth.
When enabling this functionality, files could be fragmented. Such fragments are gradually delivered to the end user according to data consumption, avoiding an abrupt data transfer that could be interrupted by the user. The Slice functionality caches data on demand at the moment the user requests it, initiating the cache operation.
Note: when activating the Slice functionality, the current cache key will be ignored and a new one will be created.
This feature works with a default slice-range of 1024kB. If you want to modify the slice-range, contact our Sales team.
Tip: initially, the Slice functionality works with the Edge Caching layer, but it’s not restricted to it. In the Slice Settings section, it’s also possible to activate the slicing on the L2 Caching layer by ticking the L2 checkbox, provided that L2 Caching is already activated.
To enable the Slice Settings feature, follow these steps:
- Access Real-Time Manager (RTM).
- On the upper-left corner of the page, select Products menu > Edge Application. The Edge Applications page appears with a list containing existing applications.
- In the table, select an Edge Application or create a new application.
- Select the Cache Settings tab. The Cache Settings List section shows a table containing the cache settings.
- Select the Cache Setting you want to enable Slice Settings.
- In the Slice Settings section, enable the Slice Configuration switch. By default, the Edge Caching setting will be automatically selected.
- If you have the L2 Caching module, check the L2 Caching checkbox to enable this option.
Note: if you don’t have the module, the L2 Caching checkbox won’t be visible in the Slice Settings section. To enable L2 Caching, contact our Sales team.
5. Caching HTTP Methods
By default, Azion only caches GET and HEAD requests. To enable the OPTIONS method, you must activate the Cache Options button within your Edge Application settings in RTM.
The HTTP cache stores a response linked to a request and reuses it for subsequent requests.
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 imply using the request body as part of the cache key.
To enable the Cache OPTIONS or the Cache POST feature, you must activate the Application Acceleration product.
6. Stale Cache
When your application’s cache passes its expiration date, it becomes stale (obsolete) and the server searches the source for the most up-to-date version. This new version, with an updated expiration date, overwrites the old one (stale).
However, the server may encounter problems and be unable to get the most up-to-date version of your application from the origin. In such cases, it delivers the latest version of it, even though it has expired. This behavior is known as Stale Cache.
Stale Cache is a standard configuration of the Edge Caching module. However, if your Edge Application needs, you can turn it off.
Warning: it’s important to remember that when disabling Stale Cache, if the server is unable to update the cache from the origin, it’ll return an error to the user, interrupting the session.
7. Advanced Cache Key
You can use Azion to deliver your dynamic or static content. Even the dynamic part of a website can often be cached for a user profile, grouped according to the specific needs of your application, such as city, browsing profile, or shopping profile.
See the documentation on the Advanced Cache Key feature from the Application Acceleration for more details on this configuration.
8. Adaptive Delivery
The Adaptive Delivery feature detects device groups you have created using the Device Groups capability, allowing you to configure how Azion delivers your content.
-
Content does not vary by Device Groups (Improves Caching): choose this option to deliver the same version of the content, regardless of device detection.
-
Content varies by some Device Groups (Allowed rules): choose this option so that Azion keeps device-based variations of its objects in the cache.
Didn’t find what you were looking for? Open a support ticket.