I am facing an issue where Safari doesn’t show my updated svg image, unless the cache is manually cleared. Sadly, it doesn’t show any image, not even the old one, just a blank space. I am only having this issue with Safari. When I inspect the element in the browser, it’s existing with correct src path. I can open the link to the source in the browser and it’s showing the image. But not on the webpage. I have tried with several devices on safari and whenever I clear the cache the image shows up, but I can’t expect website visitors to do that.
This is what I’ve tried so far:
- Renaming file
- Adding version number to file
src="/images/logo.svg?v=1.01"
- Meta Tags
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
- .htaccess config
<FilesMatch ".(svg)$">
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</FilesMatch>
Some more information:
- My website is hosted on a shared hosting service
- I am using Safari on iOS 17.4.1 and macOS Safari Version 16.6
Despite these efforts, there is still only a blank space, so I am looking for any advice.
Thank you!
joe98 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.