Cache key configuration for images
Last updated
Last updated
If a site is used for multilingual pages, it is a good idea to adjust the cache key for the images on the page.
By default, smoxy uses a combination of the Host
, the URI
and a language
cookie as the cache key.
For example, if the website is an online shop that uses different domains for different languages, several caches would be created for the same image because the host is different.
However, this is not necessary. By changing the cache key, only the URI
can be used as a value. In this way, the image cache for several language shops warms up more quickly and if a product image needs to be exchanged, only one API call is needed to invalidate the cache for this image and not one request per country shop.
As described in the Page Rules, every setting in smoxy can be changed based on the URL.
A new page rule must therefore be created in which a regex is used as a matcher. This checks whether the URL is an image URL.
Example regex: /.+.(png|jpeg|jpg|gif)$
The Cache Key option can then be selected in the settings and overwritten with the value uri
.