How to Configure and Flush the Site Cache

How to configure and flush the Site Cache in the Webscale Control Panel

The Dynamic Site Cache will cache pages or resources that are selected by a rule. Cached resources are delivered directly from the Application Delivery Controller (ADC) with very low time-to-first-byte (TTFB), bypassing the origin server. Configure rules such that only content that can be served to any user of your site is cached. Cookies are automatically removed from responses delivered from the cache.

Click the toggle to enable or disable Site Cache. When enabled, Site Cache will process the rules you create and enable.

Manage Site Cache rules

You can enable, edit, delete, and change the execution order of Site Cache rules.

  • Enable: To enable a rule, click the Enabled checkbox on the upper right of the rule. To disable, click the checkbox again.
  • Edit: To edit a rule, click the pencil box icon to the upper right of the rule.
  • Delete: To delete a rule, click the X on the upper right of the rule.
  • Change execution order: Click the 3 horizontal lines icon to the left of the rule, and then drag it to the position desired. Rules are executed in order from top to bottom.

Create site cache rules

To begin, click the Add A Rule button.

Add Site Cache Rule

  • Set the Condition: Similar to Web Controls, a condition must be set for the rule. Click + Add Condition to open the Create Condition dialog box. Then click the Select a condition… dropdown and choose the condition from the menu.
  • Set the TTL (Time-To-Live): Time-to-live specifies how long a cached page will continue to be presented to users of a site after the cached page is first created. A higher value means the page is cached for longer. Drag the slider to choose from a preset TTL, or click the Custom Time toggle, then enter the desired TTL (in seconds).
  • Set the Cache key properties: Cache key properties are used to construct a cache key for requests matching this rule. Choose from the following:
    • Browser: When enabled, browser attributes included for content optimization are used to partition the cache.
    • Hostname: When enabled, the hostname is used to partition the cache.
    • Query: When enabled, query parameters are used to partition the cache.
    • Path: The request path is always used to partition the cache, and can not be excluded.

Flush the site cache

Webscale proxies will cache web content that is served from the backend application servers based on rules defined in the Site Cache Rules. File types that are cached can include images, javascript files, CSS files, and HTML files. The images, javascript, and CSS files can also be optionally optimized by Pagespeed.

There may be times you will want to flush the contents of the site and Pagespeed caches, for instance if a major update was made to the application or site. You can flush the entire cache or specific items in the cache from both the Webscale control panel or the API.

Invalidate site cache items

Invalidate Site Cache

From here, you can invalidate specific items in the site cache, or all items in the site cache. Specify the items to be invalidated using the URLs of the items. Use a wildcard (*) to invalidate all items at a specific path. If no path is specified then the entire site cache is invalidated. Click Invalidate to proceed, or Cancel if you no longer need to invalidate the cached items.

Using the Webscale API

You can use the Webscale API to purge specific items from the cache rather than the entire cache. On the API page, enter your API key in the Enter your api_key field. Under Webscale APIs locate tasks and click on List Operations. Once here, click POST to expand the POST type action. Now add the following information in the text area under the Parameters section.

  "type": "invalidate-cache",   
  "target": "/v2/applications/<app_id>", 
   { "urls": 
      [ "*://","*.jpg"] 

Make sure to replace the placeholder <app_id> with your actual Application ID, and replace the example URLs with the actual URLs of the items to purge from the cache. You can also use the wildcard character (*) to have the action apply to multiple URLs. This is particularly useful when you want to clear certain parameters from the cache, such as all images, all web pages, and so forth.

If the action is successful, the API will respond with a 200 status code and will list all the URLs that have been purged from the cache.

Further Reading

Have questions not answered here? Please Contact Support to get more help.

Last modified September 21, 2020