Add a Cache Rule

Time-to-live (TTL) refers to the amount of time that an object is cached on Zenlayer CDN points of presence (POPs). When the TTL expires, requests that attempt to access the expired content are redirected to origin. You can add a cache rule for static contents based on file directories or file extensions.

Procedures

  1. Click one domain name in the domain list.

  2. Go to Cache Config > Add Policy to add cache expiration policies.

  3. Enable/disable Ignored Cache (Cache Without Parameter).

ParameterDescription

Type

Select Directory, File Suffix or Full Website.

  • Directory Add a cache rule for resources in a specific directory.

  • File Suffix Add a cache rule for files with the same filename suffix.

  • Full Website A default cache rule for the full site.

Expire Time

Specify the TTL. The maximum TTL is one years. Refer to the following rules:

  • A TTL of one month or longer is normally recommended for static files, such as images and application packages.

  • A TTL of 7 days is normally recommended for static files that are frequently updated, such as JavaScript and CSS files.

  • A TTL of 0 second is normally recommended for dynamic files, such as PHP, JSP, and ASP files.

Value range

Specify a weight for the cache rule.

The weight indicates the priority of the cache rule.

Valid values: 1 to 999. A larger value specifies a higher priority.

Last updated