Cache

更新时间:
复制 MD 格式

After your site is connected to Edge Security Acceleration (ESA), the ESA points of presence (POPs) determine whether to cache resource files from client request responses based on the rules in your cache configuration. After a file is cached by a POP, it can be served directly by ESA when other users request the same file. This process effectively avoids long-distance origin pulls, provides faster responses to users, reduces latency, and improves resource access efficiency. When the content that a user requests is not in a POP's cache or has expired, ESA sends an origin-pull request to the origin server to retrieve the latest data.

Features

You can use the following features to configure caching for your website.

Feature

Description

Default cache rules

Edge Security Acceleration (ESA) caches your static resources from the origin server to the point of presence (POP) nearest to the client. When you access a static resource, the system retrieves the resource from the POP instead of the origin server to improve resource access efficiency. All POPs are equipped with a caching component. When a user or an origin server interacts with an POP, the caching component caches resources from the origin server and specifies a time-to-live (TTL) for the cached resources.

Global cache configurations

Development mode

Development mode allows you to temporarily bypass the caching components of Edge Security Acceleration (ESA). This forwards all requests for static resources directly to your origin server, so you can see real-time changes to your content.

Browser cache TTL

The browser cache TTL is the validity period for web resources, such as HTML, CSS, JavaScript files, and images, that are stored in a browser's local cache. By default, this period follows the Cache-Control header of the origin server. You can configure the browser cache duration without modifying the origin server configuration to load unexpired resources directly from the local cache, which accelerates page response times and optimizes the user experience.

Edge cache TTL

Edge cache TTL determines how long Edge Security Acceleration (ESA) points of presence (PoPs) cache resources from your origin server. When the TTL for a resource expires, it is marked as stale. If a client requests a stale resource, the ESA PoP retrieves the latest version from the origin server and caches it again. You can configure an edge cache TTL for static resources by directory or file extension. This reduces the load on your origin server and accelerates content delivery.

Ignore query string

When a point of presence (POP) processes a user request to generate a cache key, you can configure it to remove the ? and the query string that follows the ?, such as user identity information and access channel source, from the request URL. This enables request URLs with different parameters to reference the same cache file, improving the cache hit ratio and reducing page load time.

Sort query strings

When you enable the query string sorting feature, Edge Security Acceleration (ESA) automatically sorts the query string parameters in a URL when processing a request. ESA then uses the sorted query string to look up content in the cache or forward the request. This means that a point of presence (POP) treats requests as being for the same file if the parameters and their values are identical, regardless of their order in the URL. This feature helps improve the cache hit ratio.

Cache rules

Create cache rules to configure the browser cache TTL

If you want to use different browser cache TTLs in different business scenarios, you can create multiple cache rules and specify different cache policies for the rules.

Create cache rules to configure the POP cache TTL

To set a cache time-to-live (TTL) for specific requests, such as those based on file extensions or request header features, you can create custom rules. This lets you configure cache settings that are different from the global edge cache TTL policy.

Configure the cache TTL for status codes

When an origin server returns a non-2xx status code, Edge Security Acceleration (ESA) points of presence (POPs) can cache the status code. For the duration of the cache validity period, the POPs respond directly to requests. This process avoids repeated origin requests and reduces the load on the origin server.

Custom cache key

You can create rules based on different parts of a user request, such as the query string, HTTP request header, or cookie, to generate custom cache keys. This feature unifies the cache key for a class of requests that access the same file. This prevents requests for the same file from being cached as different files because of varying request parameters. As a result, the cache hit rate increases, and both response time and bandwidth consumption are reduced.

Purge and prefetch

Purge cache

You can use the purge cache feature to clear cached resources from points of presence (POPs). This allows POPs to retrieve the latest resources from your origin server. Purging the cache is useful for updating content, publishing new content, or removing illicit resources. Note that purging many resources in a short period of time generates more origin requests, which increases the load on your origin server.

Prefetch content

The prefetch feature caches resources from your origin server to Edge Security Acceleration (ESA) points of presence (POPs). When a user first requests a resource, it is served directly from a POP. This avoids a trip to the origin server and improves the cache hit ratio.

Tiered cache

Multi-level cache is an advanced performance optimization technique. Edge Security Accelerator (ESA) uses this technique to cache resources from your origin server on globally distributed cache nodes at different tiers. This ensures that content is delivered from the location closest to the user, which improves overall system performance and efficiency.

Cache reserve

The cache reserve feature converges origin fetch requests to significantly reduce origin fetch traffic. When enabled, cache reserve POPs act as your top-level cache nodes. After user requests are converged by a multi-layer cache architecture, ESA fetches content from the origin server through these POPs. Cache reserve POPs also reserve storage space for you, ensuring that files cached on them are not evicted by more popular files due to low popularity.

Feature support by plan

Feature category

Detailed feature

Free (0 CNY/month)

Basic (9.9 CNY/month)

Standard (375 CNY/month)

Pro (3600 CNY/month)

Enterprise (contact sales for custom pricing)

Static resource acceleration

Global static content delivery

Supported

Supported

Supported

Supported

Supported

Cache analysis

Cache analysis

Not supported

Not supported

Supported

Supported

Supported

Cache configuration

Edge cache time-to-live (TTL)

Supported

Supported

Supported

Supported

Supported

Browser cache TTL

Supported

Supported

Supported

Supported

Supported

Query string

Supported

Supported

Supported

Supported

Supported

Query string sorting

Supported

Supported

Supported

Supported

Supported

Tiered cache

Edge cache layer

Supported

Supported

Supported

Supported

Supported

Edge cache layer + regional cache layer

Not supported

Supported

Supported

Supported

Supported

Edge cache layer + smart cache layer

Not supported

Supported

Supported

Supported

Supported

Edge cache layer + regional cache layer + smart cache layer

Not supported

Not supported

Not supported

Not supported

Contact sales for custom pricing

Cache reserve

Cache reserve

Not supported

Not supported

Not supported

Not supported

Contact sales for custom pricing

Cache purge

Purge by URL

1,000 times

10,000 times

50,000 times

100,000 times

500,000 times

Purge by directory

50 times

100 times

1,000 times

1000 times

2,000 times

Purge by hostname

Not supported

100 times

1,000 times

1,000 times

2,000 times

Purge by custom Cachekey

Not supported

Not supported

Not supported

Not supported

2,000 times

Purge by URL with parameters ignored

Not supported

Not supported

Not supported

50 times

2,000 times

Purge by tag

Not supported

Not supported

Not supported

Not supported

2,000 times

Purge all cache

five times

50 times

80 times

125 times

200 times

Cache prefetch

Instant prefetch

Not supported

10,000 entries

50,000 entries

100000

500000

Scheduled prefetch

Not supported

Not supported

Supported

Supported

Supported

Cache configuration

Development mode

Supported

Supported

Supported

Supported

Supported