Configure Cache Rules
By default, content is cached for ten minutes. This means that updates to you CMS take up to five minutes to appear on your customer site through Zephr.
You can change the cache settings, for example to do the following:
- Improve site performance when making access decisions
- Publish breaking news immediately
To configure cache rules, select the Cache Rules button in the Add a Site screen. The Cache Rules screen displays, as illustrated below:
By default, two rules are enabled. These rules refer to headers sent from your origin. You can disable them using the toggles. The rules are as follows:
Honour cache-Control: s-maxage=?. Tells proxy caches the length of the cache period. The
s-maxageheader determines when cached content is eligible for background refresh; this must be passed in responses from your origin. Disable this if you do not want the cache time to be honoured
Note: Zephr usually uses its own settings and ignores
s-manage=?. By default, content is cached for a day and refreshed in the background after five minutes. This means that there is a short delay before the updated files are served and the changes reflected on your site.
Honour Vary: User-Agent. Tells proxy caches that the cache uses the user agent to serve different pages. For example, this can be used to serve site.com/breaking-news as one version for mobile users and another version for desktop users. Disable this if you do not want to serve different versions depending on the user agent
From this screen, you can do the following:
- Add a cache rule
- Edit a cache rule
- Delete a cache rule
When you have finished configuring your cache rules, select the Done button to return to the Add a Site screen.
Add a Cache Rule
To add a cache rule, complete the following steps:
- Select the Add a Cache Rule button
The Add a Cache Rule dialog box displays, as illustrated below:
- Enter the name of the rule in the Title text box
- Enter the path on which you want to apply the rule in the URL Path text box
Note: You can use regular expressions in the URL path. For example, specifying \/breaking-news applies the rule to any path that ends /breaking-news.
- If you don’t want the URL path to use the ten minute cache period, select the Disable origin cache checkbox
- If you want to use the latest information stored in a user attribute, select the Disable user attribute cache checkbox
For example, if a user edits information that is stored in a user attribute and refreshes the page, the updated information is used if this checkbox is selected
- Select the Save button to save the rule and return to the Cache Rules screen. Selecting the Cancel button returns you to the Cache Rules screen without saving your rule
Edit a Cache Rule
To edit a cache rule, complete the following steps:
- Select the three dots for the relevant rule
- Select Edit. The Edit Cache Rule dialog box displays.
- Update the fields as required. For further information on the fields, see Add a Cache Rule
- Select the Update button to save your changes and return to the Cache Rules screen. Selecting the Cancel button returns you to the Cache Rules screen without saving your changes
Delete a Cache Rule
To delete a cache rule, complete the following steps:
- Select the three dots for the relevant domain
- Select Delete
The cache rule is removed from the list of rules.