Purge cache by Tags

Efficiently eliminate one or multiple files from iSmartFrame's cache by specifying Tags.

POST https://app.ismartframe.com/api/v1/cache/purge/tag

🌎If you are using the 'Cache By Country' feature on your website, it will be necessary to include the country code as an extra parameter in the request body.

Query Parameters

NameTypeDescription

api_key*

String

Your API Key

Request Body

NameTypeDescription

tag*

Array of strings

List of Tags requiring a cache purge.

country

String

ISO 3166-1 alpha-2 Country Code or "ALL" if you want to clear the cache for all countries

Cache purge successful. This operation may take a few minutes to propagate across all data centers.

curl --location 'https://app.ismartframe.com/api/v1/cache/purge/tag?api_key=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "tag": [
        "tag1", 
        "tag2" 
    ]
}'

How does it work?

Our platform allows you to associate one or multiple tags with a cached resource on your website under two interoperable options.

Tag by header

It is possible to configure a designated response header (e.g., Tag-Header) to be sent by your website's backend whenever the platform initiates a request. The cache header must encompass one or more tags, separated by commas. Example value: tag1, tag2, tag3.

This option proves valuable especially when you need to execute a cache purge for all pages featuring a particular article (searches, listings, etc.) on your news website or a specific product price (listings, product pages, etc.) on your e-commerce site. It's essential to ensure that your backend supports this functionality by incorporating the appropriate tags in the custom header and implementing a correct logic; otherwise, this feature may not function as intended.

Tag by pattern

If you prefer not to implement a custom tag response header (or don't need to), you can alternatively assign one or more tags to a specific URL pattern (or a precise URL). This enables tagging all URLs that match the designated pattern, facilitating a cache purge by tag on the identified resources.

Tag by folder

If you prefer not to implement a custom tag response header (or don't need to), you can alternatively assign one or more tags to a specific url based on url path structure. Example: /folderA/folderB/folderC/page.html will generate 3 tags as follow: - folder-folderA - folder-folderA-f-folderB - folder-folderA-f-folderB-f-folderC With this tags you are able to delete content inside each folder like a classic purge by folder.

In both cases, the response header "Isf-Tags" will be set by our systems in order to show the tags associated with the cached resource. This ensures that, upon retrieval, the header consistently presents itself, offering valuable insights about the tags that are intricately connected to the cached resource.

Last updated