Purge pages when the origin publishes a change
Send a purge from your publishing system when content changes: by URL on every save, and by wildcard only when images change.
You make a publishing system, such as a CMS, a commerce platform, or a build pipeline, purge the pages it changes through the Azion API or the Azion CLI, and send the same purge by hand from Azion Console. For a one-off purge of any type, refer to Purge cached content.
A published change reaches visitors only after the cached copy leaves the cache. The publishing system knows which pages changed, so it sends the purge the moment it saves them, and the cache TTL stays a safety bound for a purge that is missed.
- On every save, the publishing system sends a URL purge for the changed page and the pages that list it.
- Only when the save changes images, it also sends a wildcard purge for every size and format of those images.
- Each purge appears in the purge history when it is complete, and the next request for each object reaches the origin.
Prerequisites
Console
- A domain that belongs to your account, served by an application. A purge of any other domain is rejected with error
30003. - Access to Azion Console. Refer to Access Azion Console.
The examples purge the product page https://www.example.com/products/blue-shirt, its category page https://www.example.com/category/shirts, and the images under www.example.com/media/blue-shirt. Replace them with the objects your save changes.
Purge the changed pages on every save
A URL purge removes the exact URLs it lists. It is not recursive, so list each page the change affects: the page itself and every page that shows the changed content, such as a category page or a home page. One request carries up to 50 URLs. A URL without a scheme purges both the HTTP and the HTTPS copies.
Console
To send the URL purge by hand:
Access Azion Console > Products Menu > Real-Time Purge.
Enter one URL per item: https://www.example.com/products/blue-shirt and https://www.example.com/category/shirts.
A message confirms the creation, and Azion queues the purge.
The listed pages leave the cache once the purge propagates. A URL purge does not reach the copies that vary by cookie, device group, or image format, which the next section covers for images.
The Build e-commerce storefronts use case uses the values of this example.
Purge image variants when an image changes
Image Processor caches one copy of an image per size and per format, and a URL purge reaches none of those copies. A wildcard purge ending in * reaches all of them. Send it only when the save changes an image: Azion accepts 2,000 wildcard purge requests in a 24-hour interval, and a wildcard on every save of a large catalog can reach that bound. One request carries one expression of up to 256 characters.
Console
To send the wildcard purge by hand:
Access Azion Console > Products Menu > Real-Time Purge.
Enter www.example.com/media/blue-shirt*.
A message confirms the creation, and Azion queues the purge.
Every size and format of the changed images leaves the cache. When the publishing system knows the exact variants it serves, a cache key purge that lists each key does the same work without counting against the wildcard bound. A key carries the processing arguments after ? and the format after @@, as in httpswww.example.com/media/blue-shirt.jpg?ims=400x@@webp. For the format, refer to Cache keys.
In the Build and run marketing websites use case, this section takes these values:
| Purge | When | Items |
|---|---|---|
| Wildcard, on the Cache layer | Once per push, after its deploy completes | www.example.com/*, every page of the domain |
Every page of www.example.com leaves the cache once the purge propagates, and the next request for each one reads the new build. To confirm a purge completed, find it in the purge history, as Confirm the purge completed describes.
The Build e-commerce storefronts use case uses the values of this example.
Confirm the purge completed
A 201 from the API means the purge was accepted, not that it has propagated. Azion lists a purge in the purge history when it is complete. To confirm it:
Access Azion Console > Products Menu > Real-Time Purge.
The history lists each completed purge, and it can be filtered by the user who made it, the time, the argument list, the purge type, and the method. Filter by the argument list to find the URL or the expression you sent.
The response carries MISS, because Azion fetched the page from the origin again:
The purge is in the history, and the page served after it is the version the origin published. The request after it carries HIT again.
In the Build and run marketing websites use case, expect:
- A push reaches the page. Change the text of the
/about/page, commit, and push. Wait for the deploy to complete, send the wildcard purge, and request the page again. The response carriesx-cache: MISSand the new text, and the request after it carriesHIT.
These checks confirm the Build e-commerce storefronts use case.