Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Cache busting

Vote:
 

We have noticed that images uploaded via the CMS are served with an Expires header. Currently we use the default value of 12 hours. We have encountered a problem where an Editor changes and image but re-uploads it with the same name. 

This means the browser does not re-request the asset. The ETag does not change. 

Is it possible to append some hash or GUID to Episerver images so that they have a unique name on each change? 

#173913
Jan 12, 2017 15:18
Vote:
 

We use Mads Kristensen approach (fingerprint) for bursting cache for static client side resources - http://madskristensen.net/post/cache-busting-in-aspnet

Maybe similar approach could be used for ages as well - like adding query string parameters at the end?! To generate unique query string you can use last modified date from content data..

Not sure if that's the best approach tho

#174362
Jan 25, 2017 8:13
Vote:
 

Thanks Valdis! It worked. 

#175173
Feb 14, 2017 14:22
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.