Problem with refreshing
Moderator: General Moderators
Problem with refreshing
Hello,
I made a upload script for images but i have a problem. After the picture is uploaded i bring the user back to the picture index page. But then i see the old picture and i have to refresh. Is this a fix for this because some of my users did not know they have to refresh?
I made a upload script for images but i have a problem. After the picture is uploaded i bring the user back to the picture index page. But then i see the old picture and i have to refresh. Is this a fix for this because some of my users did not know they have to refresh?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
you use a script to return the images correct? add random data to the query string like so:
Code: Select all
<img src="e;my_image_script.php?id=123&g=12341b43bzasdf87214"e; />A good way of getting around the page caching is to use:
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
At the top your page.
I found the information at http://uk2.php.net/manual/en/function.header.php
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
At the top your page.
I found the information at http://uk2.php.net/manual/en/function.header.php
Are you sure abt this ?hongco wrote:on the same link that hyper gave you, it stated that using the header wouldn't work on image files.
I assumed
Code: Select all
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');Im pretty sure abt this because I made a gallery script and it was far faster when I removed the header.
Last edited by anjanesh on Fri Mar 18, 2005 1:15 pm, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
correctanjanesh wrote:will never get images from cache.Code: Select all
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');
Im pretty sure abt this because I made a gallery script and it was far faster then I removed the header.