Change Log

  • 26-Jul-2023 | v6.9.1 | All new article

Contributors:

Adam Wilson - Logo Pogo

Empty Cache

Clear the server-side cache for generated ‘ImageProcessor’ images throughout the site.

The “Empty Cache” function can be accessed from the gear icon () in the top right of the admin.

When manipulating images on your site using the ImageProcessor parameters, the modified images are stored in a server-side cache - to avoid having to reprocess the image unnecessarily on subsequent page views.

For example; applying a width parameter of 100px to an image like so:

<img src="/images/my-image.jpg?width=100" alt="My Image">

Results in an image of 100px width saved to the server cache which is directly linked to the above image path and parameters and is retrieved from the cache whenever that image is requested thereafter.
So, even after uploading a replacement image (with the same file name and location) the image rendered on your website may still show the cached version for all users - from the ImageProcessor cache (which cannot be refreshed by clearing the individual user’s browser cache).

Changing any of the parameters will result in a new image being generated and this method can be used to force the new image to be displayed, for example:

<img src="/images/my-image.jpg?width=101" alt="My Image">

However, this is not always a practical approach to the caching issues as it requires changes to your markup in all places the image is used as well as changes to the desired parameters (see also the ‘Asset Cache Control’ methods for similar solutions).

Therefore, a more global solution to this server-side caching issue is to use the “Empty Cache” function to clear the server-side cache directly - resulting in any ImageProcessor-created images being reprocessed from the current source image uploaded to the site.

Client-side browser caching will still apply as normal to all images even after the server-side ImageProcessor cache has been cleared. So, previous image versions may still display for some users based on the standard caching rules in place.
For testing/developing and individual use cases, clear the browser cache or perform a hard refresh after using the “Empty Cache” function for complete image cache clearing.