• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

Image updated on website, how to trigger content change on client browsers

I updated images on a website, but some of images still show old images. How can I trigger so that client browsers get all updated images when they visit next time?
0
crcsupport
Asked:
crcsupport
  • 2
2 Solutions
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
the easiest way prevent image caching is to assign a random querystring to the src link:

<img src="myFile.png?a=12345" />
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
the value of a can be a random number or a timestamp or any other random generated chars
0
 
Dave BaldwinFixer of ProblemsCommented:
There is no guaranteed way to do that.  Some people set their browser cache to 20 days which means that they may not check for new files for 20 days after the last time they checked.  When I want people to see new things on a page, I change the file names and save a new copy of the page to the server.  That let's the browser know that the main page has changed and the new file names won't be found in the browser cache.  Note that images, CSS files, and javascript files are cached Separately from the main page.  Changing the file names is the easiest way to make sure they are updated in the main page.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now