PHP: Force Reload of Image or other Content
Question by Anja Proggy | Last update on 2023-01-13 | Created on 2014-06-29
On my website, I am using an image that is created dynamically. I know that it is a good thing to cache images and other content - but the good this behavior is for the performance, the obstructive it is to me with this dynamic image.
Again and again, an old image loaded from the browser cache is shown on my website instead of the current version that is up-to-date.
How is it possible to achieve, that this individual image (or any of the content) will be refreshed with every page impression independent from any cached content?
Related Topics
How to resize Image before Upload in Browser
Tutorial | 13 Comments
HTML5: Upload Images with Client Side Resize
Tutorial | 9 Comments
Reload Images, CSS, JS and Web Pages despite Browser Cache
Tip | 2 Comments
jQuery: Send HTML5 Canvas to Server via Ajax
Tutorial | 0 Comments
Send HTML5 Canvas as Image to Server
Tutorial | 0 Comments
Mouseover buttons using CSS without reloading
Tutorial | 0 Comments
PHP: File Download Script
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Just attach a dynamic "version number" to the image URL.
So, for example, something like this :
With t=time() at the end of the URL, the browser is lead to believe, that it is always another image, because the time created with time() is always different with every site view.
Of course, you do not have to parse or use of the parameter "t" in any way, you are just presenting the image you would like to show.
More on this also in the tutorial about reloading despite the browser cache.
Last update on 2023-01-13 | Created on 2014-06-30