When you use Edge Security Acceleration (ESA) to accelerate the delivery of static resources on the origin server, ESA caches the resources on the point of presence (POP) that is nearest to the client. Then, you can access and obtain the static resources from the POP instead of the origin server. This prevents origin pulls over a long route and speeds up content delivery. All POPs are equipped with caching systems. When a user or an origin server interacts with a POP, the caching system caches resources from the origin server and specifies a time-to-live (TTL) for the cached resources.
Default cache policy
Cache configurations take effect only for client requests that are sent to the cache component of ESA. To determine whether a client request is sent to the cache component, perform the following steps:
Determine whether the request is of the GET or HEAD type.
Determine whether the request meets the conditions specified in a cache rule. If the request meets the conditions, the request uses the cache rule instead of the global cache settings. For more information, see Cache configuration validation logic.
Determine whether the type of the requested file is one of the file types listed in Extensions for default cached files. If the type of the requested file is one of the file types, the request uses the global cache settings.
Extensions for default cached files
By default, a request goes to the cache component only if the extension of the requested file is one of the extensions listed in the following table. In this case, ESA caches the file based on its matching cache rule. The TTL of the cached resource is determined by the cache rule hit by the resource.
If the resource types that you want to cache are not in the following table, create a cache rule for resources of such types. For more information, see Rules engine.
File type | File name extension |
Documents |
|
Image files |
|
Audio files |
|
Video files |
|
Compressed files |
|
Executable files (executable programs/installation packages) |
|
Font files |
|
Script and code files |
|
Design and vector graphics files |
|
Cache configuration validation logic
The edge cache TTL has four options, each of which uses different cache configuration validation logic.
Honor Origin TTL or Use Default Cache Rule: If the response returned from the origin server contains the Cache-Control header, follow its directives. If the response returned from the origin server does not contain the Cache-Control header, cache resources according to the default cache policy of ESA. For more information, see Honor Origin TTL.
Honor Origin TTL or Do Not Cache: If the response returned from the origin server contains the Cache-Control, Expires, Last-Modified, or ETag header, follow its directives. If the response returned from the origin server does not contain the Cache-Control, Expires, Last-Modified, or ETag header, do not cache resources. For more information, see Honor Origin TTL or Do Not Cache.
Do Not Cache: All resources retrieved from the origin server are not cached on POPs.
Use Custom TTL: The cache policy specified by the Cache-Control, Expires, Last-Modified, or ETag header in the response returned from the origin server is ignored and the TTL specified in ESA is used.
Cache status response
The response returned from POPs contains the X-Site-Cache-Status header, which indicates the cache status of the requested resource. The following table describes all cache statuses.
Status | Description |
HIT | The resource is found in the cache of the POP and has not expired. The POP returns the cached resource to the client. |
MISS | The resource is not found in the cache of the POP. The POP retrieves the resource from the origin server and then returns the resource to the client. |
EXPIRED | The resource is found in the cache of the POP but has expired. The POP retrieves the resource from the origin server and then returns the resource to the client. |
STALE | The resource is found in the cache of the POP but has expired. In the following cases, the POP cannot access the origin server to retrieve the updated resource and then returns the expired resource to the client:
|
BYPASS | BYPASS is returned if Honor Origin TTL is set and the origin server returns the Cache-Control:no-cache, Cache-Control:no-store, or Cache-Control:max-age=0 header. |
REVALIDATED | The resource is found in the cache of the POP but has expired. The POP retrieves the resource from the origin server and re-validates the resource by using the If-Modified-Since or If-None-Match header. If the origin server returns Status Code:304 Not Modified, the resource has not changed. Then, the POP returns the cached resource to the client. |
DYNAMIC | In the following cases, the POP considers the resource to be dynamic content, retrieves the resource from the origin server, and returns the resource to the client:
|