Create custom cache keys
A Cache Key is an identifier that Cloudflare uses for a file in our cache, and the Cache Key Template defines the identifier for a given HTTP request.
- Log in to your Cloudflare account.
- Select the domain that requires changes to the Cache Key Template.
- Select Rules > Page Rules.
- Select Create Page Rule.
- Under If the URL matches, enter the URL to match.
- Under Then the settings are, choose Custom Cache Key from the dropdown.
- Select the appropriate Query String setting.
- (Optional) Select Advanced and enter appropriate settings for:
Headers
Cookie
Host
User Features
- Choose a save option:
- Save as Draft to save the rule and leave it disabled. Note that disabled rules count towards the number of rules allowed for your domain.
- Save and Deploy to save the rule and enable it immediately.
Availability
Free | Pro | Business | Enterprise | |
Availability | No | No | No | Yes |