Images Caching Issues in Custom Modules & Blog Posts

When replacing images in custom modules and blog posts often the new images won’t update on the live site. Sometimes it takes hours for the new image to display, other times we’ve have had to physically change the url of an image to get it to update on the live site. Dumping the cache does not fix the issue and trying other browsers doesn’t clear the issue. It seems like a server caching issue causing this. This is proving to be a hard work around.

@SiroccoDigital I’m betting you are using the image processing options (ie: ?width=600&height=400) I’ve also found this to cache very heavily like you have described and noted that to Vlad quite a while back. That service caches the images on their end which is why browser cache clearing won’t work (from my understanding).
Images placed without this I haven’t seen an issue with and clearing cache should definitely refresh them.

Here’s a little bit more info on the subject (regarding the Image Processor):
http://imageprocessor.org/imageprocessor-web/imageprocessingmodule/#caching

You are correct Adam, we are using the image processing options for blogs and web apps and this functionality was built into the Treepl template we are currently using. I think we will need to remove this functionality from sites to ensure that it doesn’t cause ongoing maintenance issues.

Yeah, I do think the caching settings are too high on the Image Processor but it’s also an extremely helpful tool. Hopefully @alex and the team can make some adjustments here.

There is a common practice of having a “Clear Cache” button that would do all the work. What do you think about adding such button to the Settings?

2 Likes

Thanks @vlad.z (and good to see you in the Forums :slight_smile: ).
I think that would work well enough.

Folks, I’ve got a Treepl site that depends on the image processor feature as well. We don’t see any updates on the server ‘refresh’ cache resolution to this problem. Vlad and Treepl Team - please comment. Scott

Just raising this issue again as I’ve just come across it. The only way to solve this problem with the image processor caching images is to rename images. Do you guys still have this “clear cache” button idea on the list here @vlad.z?

In release v4.8.0-2 there was a potential fix to this problem, although it doesn’t seem to completely clear all imageprocessor cached versions.

This is from the release notes:

Fix imageprocessor

When:

  • upload image under the same name as one of the images in the folder via FTP or File Manager

    DO: remove all cached versions of the image.

  • delete image from the folder via FTP or File Manager

    DO: remove all cached versions of the image.

  • Load File Manager tab

    DO: load cached images instead of forced image resizing via URL random param

While this works for the cached images in the file manager in the admin it doesn’t seem to remove ‘ALL’ cached versions of that image as images on the front-end (using different resize params) remain cached.

@vlad.z is it possible to remove ALL cached variations of the image upon upload/replace?

@TimL as a side note, you shouldn’t need to change the image file name, rather just the resize params.
For example, if this resized imaged is cached:

<img src="/my-image?width=300">

just changing to this will cause a new image to be generated:

<img src="/my-image?width=301">
2 Likes

Added to internal backlog for future grooming sessions. If no Treepl backlog request is added (to increase priority) then this task will be delivered as one of the background features that are usually posted in the release notes under the Treepl backlog features.