Developer forum

Forum » Ecommerce - Standard features » Issues with image pattern when image changed

Issues with image pattern when image changed

Marie Louise Veigert
Reply

Hi,
We have a customer, who have set up Image Pattern on the shops.

In the browser its rendered with these extensions:

&width=1920&format=webp&quality=100

They have changed the image, and the new image have the same name as the old one. So the image should be something else.
But it seems like its cached, because the old image is still rendered.

If I remove 'format=webp' extension from the image url, the new image appears.

Anyone who have a idea why this happens?

I could just remove 'format=webp' but seems like its not the way to go :)

BR
Marie Louise


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

There are 2 levels of cache - GetImage generates a resized image and stores that in the cache. It is then send out with a cache header so the browser can cache the image.

Images will be cached on the querystring. If the date on the image on the server changes, it should also have a new one generated - but only if the browser cache is invalid so it requests the image.

Dynamicweb sends out images with a caching etag - defaults to 7 days. This is of course to ensure performance.

You can probably do a CTRL+F5 to force the new image to be loaded.

You can also disable image caching in settings by setting cache control to 1 second - that will effectively disable caching - but that would be a very bad idea.But you already run with quality 100, so it seems like performance is not a concern.

Best option is that new images have new names - or that you have patience...

Votes for this answer: 1
 
Marie Louise Veigert
Reply

Hi again,

I try to find the setting you are refeering to. I cannot find it but found this instead.

Its a DW 9.18.2

I guess this is why it doesnt change:

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Yes, it is different in DW9. BUt be careful to set it to a low number. It will impact performance, seo, lighthouse scores and conversions....

 
Marie Louise Veigert
Reply

I have tried to set it down to 1 hour - and now to 24 hours but the image still doesnt change unless I remove 'format=webp' in the Swift template

Any other suggestions? 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

The image has been sent - the browser has cached it.

Also Dynamicweb will not create a new resized image if the timestamp has not changed.

You can delete the /Files/Cache.net/Images folder - this is where Dynamicweb creates its cached version.

This is the folder - if deleted, Dynamicweb will re-create all images. Will cause a performance hit on the first visit to all the images again....

So - new images = new file names... Much easier :-)

Votes for this answer: 1
 
Marie Louise Veigert
Reply

It worked :)


Its only because we get the images named with productnumber as name to be automatic picked up by the image pattern.
The customer then changed one image - which they wont be doing often.

But this is a nice workaround. I removed all cached image for this specific product only and its now the new one.

 

You must be logged in to post in the forum