Solved

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

Posted on 2014-04-30
4
201 Views
Last Modified: 2014-05-06
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
Comment
Question by:crcsupport
  • 2
4 Comments
 
LVL 32

Assisted Solution

by:Big Monty
Big Monty earned 250 total points
ID: 40032946
the easiest way prevent image caching is to assign a random querystring to the src link:

<img src="myFile.png?a=12345" />
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 40032948
the value of a can be a random number or a timestamp or any other random generated chars
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 250 total points
ID: 40033224
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now