Configuring Caching Rules in the Portal

Note

If you have the V2 config framework, this document is superseded by Configuring Object Caching with the Performance & Delivery Rule Builder.

There are two sections to this page: Caching Configuration, which is for setting cache policies for all properties in the account, and Exceptions, which is for overriding cache policies for specific properties or in specific domains and/or specific paths in domains.

Caching configuration

Under Caching Configuration are controls to set Cache Time, Protocol Settings, and Query String in Cache Lookup ID for the entire property.

Caching configuration screen

Cache Time sets a TTL for objects in the property. The available settings are:

  • Use headers: objects will be cached according to the guidelines given in the HTTP headers from the origin; this is the default setting
  • 1 day
  • 1 week
  • 30 days
  • Don't cache: nothing in this property will be cached
  • Custom: selecting this opens two more fields immediately below: the first accepts an integer value and the second is a pulldown with the time units: day, hr, minute, or sec

You can also affect how the lookup ID is generated for the object in the cache. By default both the protocol of the request URL, and any query string that might be appended to it, are included in the cache lookup ID, which means that a request for the same object by either HTTP or HTTPS and/or with different query strings will be cached as separate objects. Excluding the protocol means that a request for an object by either HTTP or HTTPS will be served with the same identical object in the cache.

You need to take care to ensure this option is used correctly. For example, you should never exclude the protocol from the cache lookup ID for cacheable HTML pages.

Similarly, you can exclude or include the Query String in Cache Lookup ID (or parts of it). You can select Exclude, Include, or Custom.

If you select Custom, an additional input field labeled Include All Query Parameters Except appears.

Selecting Custom for configuring use of the query string in the cache lookup ID

Enter the name of the query parameter you want to exclude; if there are more than one, click the + button to add an additional input field, and repeat as necessary.

Once you have defined the caching policy for the property, click Save Settings.

Exceptions

Under Exceptions are displayed Property Exceptions, followed by Domain and Path Exceptions (if any).

Exceptions at the property level allows you to create some very specific actions that depend on conditions other than in which domain and path, using expressions to test for those conditions; when the expressions match, the action is taken. The current release of the Portal does not support editing of domains and paths that include such rules. Please contact Support if you want to have further control over caching settings than currently allowed by the Portal.

The Domain and Path Exceptions section displays a list of any exceptions that have already been defined (if any). By default it displays domain conditions only; to see any path conditions within a domain, click the right arrow icon to expand it:

 

Creating a new exception

To create a new exception, click the Add New Exception button. This will open a Create Exception form:

Create a new caching exception

In step 1, you choose an existing domain. You can also choose an existing path pattern from the pulldown, or enter a new one in the Edit Patterns field to the right, then click the Add Path button beneath the field to add it. You can repeat this action for as many paths as you need to have in this exception.

When ready, click the Next: Create Exceptions button. This takes you to step 2, where you can edit the Cache Time (TTL) for objects in this path, and whether to exclude the protocol and the query string (or parts of it) in the cache lookup ID. The choices are the same as described above for overall settings at the property level. You can also go back to step 1 if needed by clicking Edit Domain/Path (Cancel will cancel the entire exception creation process, not the current step).


create a new caching exception step 2,

When ready, click Next: Review Exception. This takes you to step 3, where you can check that everything is as desired. If so, click Create Exception:

create a new caching exception, step 3

The portal will acknowledge that your configuration update request has been submitted by displaying a temporary message like this near the top of the window:

Message from system when a configuration update task has been submitted

At the same time, the Running Tasks icon displays a number (this is the number of tasks currently running). If you hover the mouse pointer over the icon, a task message will be displayed:

Task list displayed when you click on the Tasks icon

Editing an existing exception

To edit a domain exception, click on the Edit button to the right.

To edit a path exception within a specific domain, first click on the expand button icon at the left of the domain. This displays all the paths within this domain and any exceptions that currently exist:

Editing an existing caching exception - choosing exception to edit

Choose the path you want to edit and click the Edit button to its right.

This will open a form to edit the exception:

Editing an existing caching exception, step 1

This opens the editing workflow form at step 1, where you can edit patterns using the Edit Patterns field to the right, then click the Add Path button beneath the field to add it. You can repeat this action for as many paths as you need to have in this exception. You can also delete a pattern by clicking the red - (minus) sign next to it in the list

When ready, click the Next: Create Exceptions button. This takes you to step 2:

Editing an existing caching exception, step 2

You can edit the Cache Time (TTL) for objects in this path, and whether to exclude the protocol and the query string (or parts of it) in the cache lookup ID. The choices are the same as described above for overall settings at the property level. You can also go back to step 1 if needed by clicking Edit Exception (Cancel will cancel the entire exception creation process, not the current step).

When ready, click Next: Review Exception. This takes you to step 3, where you can check that everything is as desired. If so, click Create Exception.

Editing an existing caching exception, step 3

As with adding a new rule, the portal will acknowledge that your configuration update request has been submitted by displaying a temporary message near the top of the window and the Running Tasks icon displays a number (this is the number of tasks currently running). If you hover the mouse pointer over the icon, a task message will be displayed to the effect that the configuration is being updated.

Deleting an existing exception

To delete a path exception, click on the red Delete button to the right:

Deleting an existing caching exception