Skip to content

Commit

Permalink
[Cache] Adds clarification for cache rules fields and purge (#19096)
Browse files Browse the repository at this point in the history
* Adds clarification for cache rules fields and purge

* Apply suggestions from code review

Co-authored-by: Pedro Sousa <[email protected]>

---------

Co-authored-by: Pedro Sousa <[email protected]>
  • Loading branch information
angelampcosta and pedrosousa authored Jan 9, 2025
1 parent c428459 commit d053e1d
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/content/docs/cache/how-to/cache-rules/settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,28 @@ These are the settings that you can configure when creating a cache rule.

## Fields

The fields available for Cache Rule matching expressions in the Expression Builder are:

* Cookie - `http.cookie`
* Hostname - `http.host`
* Referer - `http.referer`
* SSL/HTTPS - `ssl`
* URI Full - `http.request.full_uri`
* URI - `http.request.uri`
* URI Path - `http.request.uri.path`
* URI Query String - `http.request.uri.query`
* User Agent - `http.user_agent`
* X-Forwarded-For - `http.x_forwarded_for`
* Request Headers - `http.request.headers`
* Cookie value of - `http.request.cookies`

For a list of all available fields refer to [Fields](/ruleset-engine/rules-language/fields/).
The fields available for Cache Rule matching expressions in the **Expression Builder** are:

- URI Full - `http.request.full_uri`
- URI - `http.request.uri`
- URI Path - `http.request.uri.path`
- URI Query String - `http.request.uri.query`
- Cookie - `http.cookie`
- Hostname - `http.host`
- Referer - `http.referer`
- SSL/HTTPS - `ssl`
- User Agent - `http.user_agent`
- X-Forwarded-For - `http.x_forwarded_for`
- Request Headers - `http.request.headers`
- Cookie value of - `http.request.cookies`
- File extension - `http.request.uri.path.extension`

If you select the [**Edit expression**](/ruleset-engine/rules-language/expressions/edit-expressions/#expression-editor) option, you can enter any of the [available fields](/ruleset-engine/rules-language/fields/).

:::note

Not all fields are available as a trigger for Cache Rules due to incompatibility with [Purge](/cache/how-to/purge-cache/).
The fields mentioned above support all types of purge. However, the [remaining available fields](/ruleset-engine/rules-language/fields/) support purge by tags, prefix (URL), hostname, and everything but are not compatible with [single file purge](/cache/how-to/purge-cache/purge-by-single-file/).

:::

## Operators
Expand Down

0 comments on commit d053e1d

Please sign in to comment.