Cache Breaker endpoints

Aurora includes special handling for default images, to ensure that accessing these assets are super fast while allowing a rapid roll-out of replacement images. The result of this special handling are the cache breaker endpoints.

Overview

In brief, this pair of endpoints allows:

  • A globally shared cache breaker value to be retrieved by any system that generates default images (to ensure the same cached data is used everywhere).
  • Refreshing of the cache breaker to force browsers / clients to download the new image.

Where Cache Breakers are used

Aurora creates & tracks cache breaker values to use for the value of the 'cb' query parameter when retrieving a product's default image (E.g. https://example.com/p/default/no_image_available?cb=2022-11-24_11%3A48%3A13) or a template image (e.g. https://example.com//t/3069857465/_images/banners/homepage_3.jpg?t=rw&w=500&cb=2024-03-04_10%3A54%3A07)

How Aurora uses the Cache Breaker Value

When replacing the default image via the Aurora backend the system automatically generates a new cache breaker for you.

When retrieving a template image to display using the content_image_uri smarty function the cache breaker will be automatically appended to the image url.

Any change to the cache breaker value (either through replacing the default image or when Generating a new cache breaker via Site Settings) will automatically propagate through the system to any images that are generated via the product_image_uri and content_image_uri smarty functions.

Retrieving a Cache Breaker Value

The get cache breaker endpoint may be used to retrieve the current (global) cache breaker value.

The current cache breaker value is also displayed in Site Settings within the Images tab.

The below recipe demonstrates how a default image URL may be manually generated with a cache breaker value retrieved from this endpoint.

Generating a new Cache Breaker Value

A new cache breaker can be generated within Site Settings > Images by clicking on the Generate New Image Cache Breaker button.

The generate new cache breaker endpoint may be used to generate a new cache breaker value.

The below recipe demonstrates how a to force the cache breaker value to be refreshed.