Application Accelerator settings
Look up the fields, values, and defaults that turn on Application Accelerator and set cache variation, HTTP methods, and Rules Engine behaviors.
Application Accelerator is a Platform Resource that unlocks four capabilities for the cache and the rules of an Application. The capabilities are cache variation, the caching of POST and OPTIONS responses, a Max Age below 60 seconds, and the Rules Engine behaviors and variables that this page lists. Each Application turns Application Accelerator on separately. This page carries the name, the type, and the default of each field, and the interface that sets it.
Application Accelerator switch
Application Accelerator is off in a new Application, and the setting belongs to the Application, not to a cache setting. So one Application can have Application Accelerator on while another has it off. Each interface turns on the same setting, which API v4 stores in modules.application_accelerator.enabled:
| Interface | Where you set it | Field or flag |
|---|---|---|
| Azion Console | The Modules section of the Main Settings tab of an Application | The Application Accelerator switch |
| Azion API v4 | PATCH /workspace/applications/{id} |
modules.application_accelerator.enabled |
| Azion CLI | azion update application |
--application-accelerator |
azion.config.js |
The AzionApplication object |
applicationAcceleratorEnabled |
| Azion Lib | The data passed to an Application update, because API v3 refuses the field on create | application_acceleration |
modules.application_accelerator.enabled is a boolean and defaults to false. applicationAcceleratorEnabled and application_acceleration are booleans, and the Azion CLI flag takes a string.
The Azion Terraform Provider manages the Application resource that carries the switch. Turning on Application Accelerator can generate usage-related costs. For more information, refer to Pricing.
Cache variation
Every cache setting carries its own modules.application_accelerator object, which shares its name with the object of the Application. The Application’s object holds only enabled, and the cache setting’s object holds the variations. With Application Accelerator on in the Application, the fields of the cache setting’s object can leave their defaults.
Those fields configure Advanced Cache Key, a Feature of Application Accelerator. They decide which parts of a request, besides its scheme, host, and path, produce a separate cached object. A cookie, device group, or cached POST variation appends the @@ separator to the cache key, and so does a query-string variation under allowlist or denylist, as @@? and its arguments. Under all, the whole query string follows the path, before @@. A cached OPTIONS response adds only the options prefix, with no @@. For the format of a cache key, refer to Cache key format.
Each field maps to a control in the Application Accelerator section of a cache setting, in Azion Console, which shows that section only while Application Accelerator is on in the Application:
| Field | Type | Default | Console control | What it sets |
|---|---|---|---|---|
cache_vary_by_method |
array of enum, at most 2 values: options, post |
[] |
Cache vary by Method, one checkbox per method | The request methods whose responses are cached. |
cache_vary_by_querystring.behavior |
enum: ignore, all, allowlist, denylist |
ignore |
Cache vary by Query String > Behavior | The mode that decides how the query string varies the key. |
cache_vary_by_querystring.fields |
array of string | [] |
Cache vary by Query String > Fields | The query string arguments the mode applies to. |
cache_vary_by_querystring.sort_enabled |
boolean | false |
Cache vary by Query String > Sort | Whether the variations group under one key, ordered alphabetically. |
cache_vary_by_cookies.behavior |
enum: ignore, all, allowlist, denylist |
ignore |
Cache vary by Cookies > Behavior | The mode that decides how cookies vary the key. |
cache_vary_by_cookies.cookie_names |
array of string | [] |
Cache vary by Cookies > Fields | The cookies the mode applies to. |
cache_vary_by_devices.behavior |
enum: ignore, allowlist |
ignore |
Cache vary by Devices > Behavior | The mode that decides how device groups vary the key. |
cache_vary_by_devices.device_group |
array of integer | [] |
Cache vary by Devices > Device Group | The device groups the mode applies to. |
In Azion Console, the Behavior dropdowns of Cache vary by Query String and Cache vary by Cookies show Allowlist, Denylist, Ignore, and All. The one of Cache vary by Devices shows Allowlist and Ignore.
allowlist and denylist on the query string need at least one argument in fields, or the API returns error 21018. While Application Accelerator is off in the Application, the API refuses a variation with error 21013. For every error a cache setting returns, refer to Cache settings.
One field on the same cache setting sits outside that object and still requires Application Accelerator:
| Field | Type | Default | Console control | What it sets |
|---|---|---|---|---|
modules.cache.max_age |
integer, 0 to 31536000 seconds |
60 |
Cache > Max Age | How long the cache holds the object. A value below 60 requires Application Accelerator. |
Without Application Accelerator, a max_age below 60 returns error 21021. With Application Accelerator and Tiered Cache on, a value below 3 returns error 21020.
For the ceilings that bound a cache setting, refer to Limits.
Cache setting flags in Azion CLI
azion create cache-setting writes most of these fields from the command line. Each flag sets one field of the cache setting:
| Flag | Field it sets | Default |
|---|---|---|
--cache-by-query-string |
cache_vary_by_querystring.behavior |
ignore |
--query-string-fields |
cache_vary_by_querystring.fields |
None |
--cache-by-cookies |
cache_vary_by_cookies.behavior |
ignore |
--cookie-names |
cache_vary_by_cookies.cookie_names |
None |
--enable-caching-for-post |
options and post in cache_vary_by_method, with either value |
None |
--enable-caching-for-options |
options in cache_vary_by_method, with either value |
false |
On create, either value turns a method on, so caching POST without OPTIONS takes cache_vary_by_method in a --file body. azion update cache-setting honors true and false. On update, a call that passes one method flag drops the other method, so pass both flags to keep both.
azion create cache-setting takes sort_enabled, device-group variation, and the cache max_age only in a --file body. On azion update cache-setting, --enable-caching-string-sort sets sort_enabled. --browser-cache-max-age sets the browser value alone.
HTTP methods
An Application passes OPTIONS, POST, PUT, PATCH, and DELETE to the origin with or without Application Accelerator, as it does GET and HEAD. Of those five methods, Application Accelerator makes the responses of two cacheable, through cache_vary_by_method.
| Method | Response can be cached |
|---|---|
OPTIONS |
Yes, when cache_vary_by_method carries options |
POST |
Yes, when cache_vary_by_method carries post |
PUT |
No |
PATCH |
No |
DELETE |
No |
A cached POST or OPTIONS object gets its own cache key. For the shape of that key, refer to Cache key variations.
Rules Engine behaviors
These Rules Engine behaviors require Application Accelerator on the Application that runs the rule. The table indexes them; Rules Engine owns the arguments and the syntax of each one.
| Behavior | Phases | What it does |
|---|---|---|
| Add Request Cookie, Add Response Cookie | Request, Response | Adds a cookie to the Set-Cookie header. |
| Bypass Cache | Request | Stops Azion’s cache from storing the origin response, and leaves the browser cache untouched. |
| Capture Match Groups | Request, Response | Stores a regular expression capture over a request field in a temporary variable. |
| Filter Request Cookie, Filter Response Cookie | Request, Response | Removes a cookie from the request to the origin or the response to the user. |
| Forward Cookies | Request | Forwards the Set-Cookie header of the origin to users, including on a cache hit. |
| Rewrite Request | Request | Modifies the resource path requested from the origin. |
Bypass Cache acts on Azion’s cache and not on the Tiered Cache layer. An Application whose cache settings have Tiered Cache on keeps caching objects there for the Max Age of the cache setting.
Rule criteria can read ${request_uri} and ${device_group}, and both require Application Accelerator. A rule that reads ${request_uri} without it is refused with 25047. For the variables, refer to Variables, and for the groups ${device_group} matches, refer to Device Groups.
Set Cache Policy works without Application Accelerator. It applies a cache setting of the Application, and it is how a cache setting reaches a request.
Run Function also works without Application Accelerator. It runs a Function Instance of the Application, and it requires Functions.