smoxy
English
English
  • Welcome to smoxy
  • Changelog
  • Support Contact
  • Migration of Load Balancers and Domains
  • Account
    • What is an Account?
    • Site Overview
      • Add a new domain
    • Origins & Loadbalancer
    • Domain Overview
      • SSL
    • DNS Overview
    • Team
    • IP Lists
    • Billing
  • Sites
    • What is a Site?
    • Dashboard
    • Page Rules
      • Page Rules - Use Cases
    • Conditional Rules
      • Conditional Rules - Use Cases
    • Image Optimization
    • Acceleration
    • Security
    • Basic Configuration
    • Redirect Sites
  • Developer Guide
    • GeoIP Headers (Request Metadata)
    • Cache Invalidation
    • Best Practices
      • Services Sites
      • Flush Tags
      • Test configuration options
      • Cache key configuration for images
    • Cloudflare Setup
    • Frameworks
      • Shopware 6
Powered by GitBook
On this page
  • Advantages of a dedicated cache key for images
  • Setting a cache key for images

Was this helpful?

  1. Developer Guide
  2. Best Practices

Cache key configuration for images

Last updated 7 months ago

Was this helpful?

If a site is used for multilingual pages, it is a good idea to adjust the cache key for the images on the page.

Advantages of a dedicated cache key for images

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.

Setting a cache key for images

As described in the , 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.

Page Rules