Jump to content

Archived

This topic is now archived and is closed to further replies.

jayR

Caching problem

Recommended Posts

I'm working with a report that is generated from our database.  It seems to be working fine, except once in a while IE will cache the results and you'll have to refresh the page multiple times or sometimes even close the browser and reopen it in order for the newest results to be displayed.  I have header("Cache-control: private"); on the top of each of my pages, so I'm not sure what else I can do.  Any help would be appreciated.  Thanks

Share this post


Link to post
Share on other sites
try this

[code]
//Send some headers to keep the user's browser from caching the response.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
header("Cache-Control: no-cache, must-revalidate" );
header("Pragma: no-cache" );
header("Content-Type: text/html; charset=utf-8");
[/code]

This is kind of strange though. I know that IE has some caching issues that I think are a real pain but I never had a problem with phpand ie caching, it wasn't until I started using Ajax that it gave me a headache. in any event the above is what I have been using on my Ajax pages and it should work good for you too.

Share this post


Link to post
Share on other sites
Just clear the cache.
For IE Tools>Internet Options>Delete Files

Share this post


Link to post
Share on other sites
Thanks Drumminxx, that did it.  And I couldn't just clear the cache each time because I didn't want to users to have to do that when they were viewing the reports.  That would sure get annoying fast for them.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.