Jump to content

Caching problem


jayR

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
Link to comment
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.
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.