How can I display the latest version of an image when the image is saved in the cache?
-
I'm trying to figure out how I can display the latest version of an Image that is re-uploaded without having the user have to empty their cache. Typing "www." in the address also doesn't seem to help. There must be a simple solution to this. (Also, I am using timthumb with this: http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/.)
-
Answer:
Add a parameter to the URL. 'flower.jpg?v=123' will cause a client to grab a new version and the server will ignore the parameter. Keep track of the version number (123 in this example) and keep it consistent to take advantage of the user's cache, and increment the version number when the image has changed and you want them to grab the new version.
Kevin Fox at Quora Visit the source
Other answers
This can also be accomplished on the server side by adjusting the HTTP Expires response header, or by using ETags: http://en.wikipedia.org/wiki/HTTP_ETag
Andy LeMay
You can do it using etags (did not see that in the code) or the if-modified-since header (support is there in timthumbs). The function you are looking for is probably: show_cache_file
Shyam Somanadh
Related Q & A:
- How do I display all categories on a page with a corresponding image?Best solution by Magento
- How can i download yahoo messenger version 8 or other than version 9?Best solution by Yahoo! Answers
- How can I turn a trial version game into the full version?Best solution by Yahoo! Answers
- How can I download the latest flash player to my PSP?Best solution by Yahoo! Answers
- Where can I get the latest version o yahoo msg?Best solution by news.softpedia.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.