Skip to main content

Configure Cache Rules

Zuora

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:

Cache_Rules.jpg

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-maxage header 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:

  1. Select the Add a Cache Rule button

    The Add a Cache Rule dialog box displays, as illustrated below:

    Cache_Rule_Add.jpg

  2. Enter the name of the rule in the Title text box
  3. 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.

  4. If you don’t want the URL path to use the ten minute cache period, select the Disable origin cache checkbox
  5. 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

  6. 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:

  1. Select the three dots for the relevant rule
  2. Select Edit. The Edit Cache Rule dialog box displays.
  3. Update the fields as required. For further information on the fields, see Add a Cache Rule
  4. 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:

  1. Select the three dots for the relevant domain
  2. Select Delete

The cache rule is removed from the list of rules.