Application Accelerator in the application request path
Follow a request through an application that varies its cache key, from the Rules Engine rule to the cached object or the origin.
This design serves an application whose responses depend on more than the URL: an API that answers differently per query string, a catalog that differs per device, a page that varies per session. Application Accelerator puts those inputs into the cache key, so the cache can tell two correct responses apart instead of serving one of them to everyone or caching neither.
It suits teams whose dynamic paths reach the origin on every request because a URL-keyed cache cannot represent what makes those requests different.
The request path
- A client requests a domain associated with the application. Workloads registers that domain with Azion.
- The application receives the request in the nearest data center and Rules Engine evaluates its request-phase rules.
- A rule decides what happens to the cache. Set Cache Policy applies a cache setting; Bypass Cache sends the request to the origin and caches nothing.
- The cache key is built from the URL plus every variation the cache setting names: the allowed query string arguments, the named cookies, the device group, and, for a cached
POSTorOPTIONS, the MD5 hash of the request body. - A key already in the cache is answered from the stored object. A key that is not reaches the origin, and the response is stored under that key for the TTL the cache setting carries.
- A request carrying the
Pragma: azion-debug-cacheheader gets the key back in theX-Cache-Keyresponse header, which is how you confirm the variation is the one you configured.
Two behaviors change the shape of this path rather than its steps. A Max Age of 0 seconds keeps the request on the cache path while collapsing simultaneous requests into one origin request, where Bypass Cache leaves the cache path entirely. For that difference, and for what each variation costs, refer to Cache variation.
Components
- Applications holds the delivery configuration, the cache settings, and the rules, and is where the Application Accelerator module is turned on.
- Cache holds the objects and owns the cache key format that every variation appends to.
- Rules Engine decides which requests a cache setting covers, and carries the behaviors this module unlocks.
- Application Accelerator supplies the cache variation, the caching of
POSTandOPTIONSresponses, and the cache TTL below 60 seconds. - Workloads registers the domain that serves the application.
Implementation
- Create an application, in Azion Console, through the Azion API, or with Azion CLI. For the steps, refer to Applications quickstart.
- Register the domain that serves it. For the steps, refer to Add a custom domain to a workload.
- Turn on Application Accelerator and create a cache setting that varies by the attribute your responses depend on. For a query string or a cookie, refer to Configure Advanced Cache Key for an application. For a
POSTresponse, refer to Cache POST and OPTIONS responses. - Apply the cache setting with a Rules Engine rule, and add any bypass or cookie-forwarding rule the design needs. For the steps, refer to Configure cache policies for an application.
- Point your domain’s CNAME record at the Azion endpoint for that domain.
- Confirm the variation with the
Pragma: azion-debug-cacheheader, then watch the cache status over real traffic and adjust the variation rather than the TTL when the cached object count grows faster than the content.
Plan the purge alongside the variation. A URL purge does not reach objects that vary by cookie or device group, so those need a cache key purge or a wildcard purge. For the purge types, refer to Real-Time Purge.