You can specify cache tags to purge only cache-tagged resources. Purging by tag purges cached resources served with a cache-tag response header that matches one of your specified cache tags.
How it works
Purging by tag is a good choice when you want to purge aggregated datasets or a collection of objects that are heavily interdependent. This option is especially efficient in scenarios where tens of thousands of objects must be purged at the same time. Purging by tag dramatically streamlines content management at the origin and edge.
Scenario
For example, a soccer website that displays live scores for its audiences has statistics for live game scores, individual player statistics, live league tables, leaderboards for goalscorers, and other aggregated player and team statistics for a variety of attributes.
Typically, every play will require purging of multiple objects that need to be separately selected. With different teams playing in different tournaments and leagues simultaneously, purging these objects gets increasingly complicated. Purging by tag allows you to assign tags to these objects for better manageability. You can now tag objects with team names or tournament names to purge everything related at a time.
How POPs treat cache tags
When a request reaches an ESA POP, the POP:
Adds tags to the content if the request contains the
Cache-TagHTTP header.Does not remove the
Cache-Tagheader by default before sending the response to your website visitors. This way, visitors can see the cache tags on your website (if proxied).Removes whitespaces from the header and before and after cache tags.
tag1,tag2andtag1,tag2are considered the same.Removes all repeated and trailing commas before applying cache tags:
tag1,,,tag2andtag1,tag2are considered the same.
Before you begin
To use purging by tag, you need to first add the Cache-Tag HTTP response header. You can add cache tags in Cache-Tag for your web content to allow the client and server to pass additional information in requests or responses.
Cache-Tag name
You can configure the Cache-Tag name by website.
Cache-Tagis used by default. The default name can be used without additional configurations, and can be identified by the origin server in a way similar to howCache-Controlis processed. If you want to change the cache tag name, submit a ticket.The aggregate Cache-Tag name cannot exceed 16 KB.
Cache-Tag format
Separate the Cache-Tag name and valid values with a colon (:). Example:
Cache-Tag: tag1,tag2,tag3.Cache-Tag value
You can add multiple Cache-Tag values. Separate the values with commas (,).
Each cache tag must be at least 1 byte in length.
Individual cache tags do not have an upper length limit, but the aggregate Cache-Tag HTTP header cannot exceed 16 KB. This length includes whitespaces and commas but excludes the header field name.
The Cache-Tag HTTP header can contain up to 1,000 tags.
The Cache-Tag HTTP header must contain only UTF-8 encoded characters.
By default, cache tags are case-sensitive. To change the Cache-Tag HTTP header to not case-sensitive, submit a ticket. When the Cache-Tag HTTP header is not case-sensitive, the tags are converted to lowercase before being added to a cached resource.
Purge cache by tag
In the ESA console, choose Websites and click the website name you want to manage.
In the left-side navigation pane, choose .
On the Purge Cache tab, configure the purge settings.
Type: Select By Tag.
Purge Method: Select Mark as Expired or Delete.
Mark as Expired
If the requested content is one of the resources that you submit to purge, the nearest POP checks the Last-Modified parameter of the resource on the origin server. If the parameter value is the same as that of the cached resource, the POP serves the cached resource. Otherwise, the cached resource is considered expired. In this case, the POP fetches the latest version from the origin server, delivers it to the client, and updates the cache with the new version.
Delete
If the requested content is one of the resources that you submit to purge, the nearest POP fetches the latest version from the origin server, delivers it to the client, and updates the cache with the new version.
Purge Content: Enter the tags that you want to use for purging. Separate them with commas (,). Example:
dog,cat,shop

Click Submit.
View the purge progress.
You can view the progress and details of a purge task on the Purge Records tab. The purge task is complete when the progress reaches 100%. The duration varies based on the number of objects that you want to purge.
If you select Upload File for purging, you can view the upload status on the Upload Records tab. After the file is uploaded, the purge task starts. You can view the purging status of each file on the Purge Records tab.

Availability
Quota | Entrance | Pro | Premium | Enterprise |
Purge tasks per day | No | No | No | 2,000 |