How To Purge the Cache
This article is a quick guide to purging your cache using the portal and the cache purge API. More details can be found in the Purging Your Cache in the Portal article in the Using the Customer Portal section and the Cache Purge API Guide.
Using the Portal
- Click on Config > Cache Purge to display the Cache Purge page:
- Select the Cache Purge Specificity. This can be
- Multiple URLs
- Single URL
- Complete domain
- Follow the on-screen directions depending on which type of purge. For more details see Purging Your Cache in the Portal.
- Click Purge Cache. You will see a confirmation message. Click Yes, Purge Cache to proceed with the purge.
Full domain and prefix purge operations can potentially purge a large number of objects from the cache, which can temporarily affect your site's performance.
Using the Cache Purge API
A purge request is made by sending a JSON object to the Cache Purge API. It contains a purge_request block with an action field that specifies the type of purge request, and a uris block that contains uri objects, each of which has a match_mode that specifies the type of purge (EXACT_LITERAL or PREFIX_LITERAL) and a uri_pattern field.
Say you wanted to purge all cached images in the path /img and all CSS files in the path /css on the site acme.com. The purge_request would be:
Note that the uri_pattern needs to begin with the protocol and domain name, unlike the path you give in the Portal.
Execute the command
where you would of course use your own authorization string and company name in place of the placeholders.
Using Advanced REST client plugin for Chrome:
In the URL field at the top enter
- Click the POST radio button.
In the Headers field, add a header named Authorization with a value
where authorization_string consists of your username and password separated by a colon (:) and then base 64-encoded.
- Type the purge_request JSON (shown above) in the Raw payload field.
- Click Send.
By any method, if successful, the API server will respond with a JSON object similar to the following:
For more details see the Cache Purge API Guide.