Use Rules to set up custom settings for certain file types or paths.
To add Rule go to CDN Resources, then Settings, choose Rules and click Add rule.
The Rule can have Literal or Regular expression Match Type. For Literal enter the URL, which the rule will be applied to, to the Rule pattern field. For Regular Expression specify the path or file types by the regular expression.
Rules settings are equal to the Resource Settings.
How Rules interact with the resource settings
If an option isn't added in Rule, the value is inherited from the resource settings.
For example, if you set up the option like this
cache setting for the content you specified in Rules will be inherited from the resource settings.
If the option is added to Rule and disabled, the option won't set up to the Rule. Option value that is specified in resource settings isn't inherited.
For example, in the resource settings access to the content is restricted from Russia, and in Rule Country Access Policy slider is on the left and the option is grey
no country restrictions will be applied to the content specified in the Rule.
If the option is added to Rule and has its own value, to the Rule content will applied value you set up in Rule.
For example, in the resource settings Cache Expiry is 4 days and in the Rule Cache Expiry is 30 minutes
content in Rules will be cached for 30 minutes and all the other content for 4 days.
For example, to forbid caching of jpg, css, js files in CDN enter this to the Rule Pattern:
In Cache Settings choose Cache Expiry "0 seconds".
Click Add Rule.
To set up HTTP-header Access-Control-Allow-Origin only for ttf files enter this to the Rule Pattern:
Then go to the Access (Security) section, click Add Option and choose Access-Control-Allow-Origin Header option.
You can add the header to all requests or just to the requests from the specified domains. Read more about this option.
Notice that your main settings do not automatically apply to the Rules. For example, if you have content access restrictions, you need to add them to the Rule settings, or the content mentioned in the Rules will be available without any restrictions.