Assign cache tags
There are a few ways you can add cache tags to your content.
Cache tag behavior
Configure cache tags with the Property Manager behavior. This feature directly adds a cache tag to the object when it's first put into the edge servers' cache. Each instance of the Cache Tag behavior can only take a single value, which can be a variable. If you want to specify more cache tags for an object, add multiple instances of this behavior to your configuration, and their values will all be combined.
You can't tag content that's already cached or when using NetStorage as your origin.
Edge-Cache-Tag header
You can also define cache tags at the origin server level by configuring the Edge-Cache-Tag
response header. For each object, specify a single header with up to 128 comma-delimited values. If you add more headers for the same content, only the first one is respected.
This example shows how you might overlap tag categories:
Edge-Cache-Tag: casual, knits, fall-sale
Ordinarily, your end users never receive the Edge-Cache-Tag
header. You can use Property Manager's Cache Tag Visibility behavior to override that for any segment of your content, either always, or on demand.
Logically, consider cache tags as part of the tagged content. Thus, new or changed tags need to be returned with a 200 response from the origin. A 304 response doesn't update the cache tags. To make sure that tags are assigned to all targeted objects on the Akamai network, wait until they refresh based on their TTL value, or explicitly purge them when adding or changing tags.
Syntax requirements for creating new tags
-
A single tag can't exceed 128 characters. If your tag is longer than 128 characters, the associated content won't be purged.
-
For
Edge-Cache-Tag
only: Multiple tags must be delimited by a comma. For example,casual, knits, fall-sale
. -
For
Edge-Cache-Tag
only: Tags are formatted based on a token specified in RFC 7230, Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing. -
The maximum number of tags per cached object is 128. Any additional tags are ignored. Note that the default Akamai max response header size is 8192 bytes.
-
Cache tags are case-sensitive, for example,
tag-abc
andTag-Abc
are treated as distinct tag values.The following table lists allowed and disallowed cache tag characters.
Allowed Disallowed Alphanumeric Angle brackets (< >) Ampersand (&) Asterisk (*) Apostrophe (') At sign (@) Circumflex (^) Backslash (\) Dash (-) Braces ({ }) Dollar sign ($) Colon (:) Exclamation mark (!) Comma (,) Grave accent (`) Double quote (") Hash sign (#) Equal sign (=) Percent sign (%) Open/closed parenthesis (( )) Period (.) Question mark (?) Plus (+) Semicolon (;) Tilde (~) Space ( ) Underline (_) Square brackets ([ ]) Vertical bar (|) Slash (/)
Akamai Drupal 8 module
If you use Drupal for content management, the Akamai Drupal 8 module can help you tag content. For information on effective ways to use cache tags to purge content, see Cache tag use cases.
Updated 7 months ago