How can we use the versioning for the images without updating its reference but still don't face browser cache issues

Avatar

Avatar

NaziyaP

Avatar

NaziyaP

NaziyaP

01-01-2021

Dear All,

How can we update image in DAM so that its versioned file can automatically be referenced in the html.

 

Suppose I have uploaded an Image XYZ.jpg and have given path in html as

<img alt="XYZ image" tabindex="1" class="XYZImage" src=“path_to/XYZ.jpg“/>.
 
Now I want to update this Image with another and I want that I only update the image in the DAM like XYZ.jpg-v-2 and my html automatically refers to the new version without any code change so that no browser cache issue come.


Please note, browser cache cannot be disabled at server, its necessary to keep that

DAM Assets image versioning
View Entire Topic

Avatar

Avatar

kunal23

MVP

Avatar

kunal23

MVP

kunal23
MVP

03-01-2021

You can set caching headers appropriately in apache to invalidate the browser cache after the time to live (max-age) value expires. However, It is not good for page performance to set low TTL values for browser cache. 

 

<LocationMatch "^\.*.(jpeg|jpg)$">
     Header set Cache-Control "max-age=222"
     Header set Age 0
 </LocationMatch>