Creating cache rules

You can create cache rules on Mlytics and it will apply to all the CDNs you have installed and activated for your domain. You do not have to create separate rules for each CDN. 

To access, click the ‘CDN’ tab on the navigation bar, and navigate to 'Multi CDN', then go to 'Cache control'. 

There are two types of cache rules you can create:

  • Cache rules: tells the system the specified path/resource to cache.
  • No-cache rules: the opposite of cache rules, tells the system the specified path/resource to NOT cache.

Cache rules

On ‘Cache control’, select ‘Cache rules’, and click 'Add cache rules'.

You can then customize the cache rule:

  • Directory: a specific path without the file and file name. The URL must have a slash ('/') in the beginning and at the end (e.g. /url_path/).
  • File extension: a specific file type. A period ('.') must be included in front of the file type (e.g. .jpg).
  • Advanced (Enterprise plan only): you can include wildcards (asterisks) in your path matches. The rule must include at least one asterisk (e.g. /*/file.jpg).
  • Expiry: when this cache rule will expire.

No-cache rules

On ‘Cache control’, select ‘No-cache rules’, and click 'Add no-cache rules'.

You can then customize the no-cache rule:

  • Directory: a specific path without the file and file name. The URL must have a slash ('/') in the beginning and at the end (e.g. /url_path/).
  • File extension: a specific file type. A period ('.') must be included in front of the file type (e.g. .jpg).

Honor origin (Enterprise only)

For enterprise plan users, there is an option to adapt the cache rules set in your origin server. This is done by activating the ‘Honor origin’.

To activate, go to ‘Cache control’, select ‘Cache rules’, and click 'Add cache rules' (or ‘Edit cache rule’). Inside the dialog box, click ‘Advanced settings’, and then turn on the ‘Honor origin’ toggle switch. 

This function is available for these CDNs:

  • Alibaba
  • Akamai
  • Baishan / Chinacache
  • Cloudfront
  • Cloudflare
  • Fastly
  • GMA / CN2
  • Stackpath
  • Tencent
  • Wangsu / CDNetworks
  • Vnetworks