Update images saved in cache

Asked

Viewed 17 times

0

I have a client who is with a protelam on their site ads, because when replacing an image it is not updated due to the cache saved in the browsers. The site was made in ASP. And I’ve used some techniques such as

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />

And

<%
Response.addHeader "Cache-Control", "no-cache, no-store, must-revalidate" ' HTTP 1.1.
Response.addHeader "Pragma", "no-cache" ' HTTP 1.0.
Response.addHeader "Expires", "0" ' Proxies.
%>

With no success.

  • One way is to add a timestamp at the end of the file name, preceded by a ?, something like: imagem.jpg?20190311175900, which would be the year + month + day + hours + minutes + seconds... this way the image will never have the same name and will not be pulled from the cache

  • One way is to change the file . htaccess, as indicated in this answer: https://answall.com/a/353571/8063

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.