Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Safari and caching

Safari and caching
Thread Tools
ryochiji
Junior Member
Join Date: Apr 2001
Location: Sunnyvale, CA
Status: Offline
Reply With Quote
Mar 16, 2003, 01:43 AM
 
I was wondering if anyone else was having problems with Safari caching PHP-generated pages, even when specifically told not to.

I have pages that do:
Code:
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0
at the top of each page, but Safari seems to cache them anyway. Anyone else seen this? Any workarounds? Is this a known bug in Safari? TIA.
     
Simon Mundy
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Mar 17, 2003, 05:02 AM
 
I think the problem is at client-side rather than server-side - changing the headers won't always work.

What I do as a quick'n'dirty workaround for situations like this is add a timestamp to a GET parameter. For example, if I have an image that needs to be constantly refreshed, I display it as:

IMG src="img.gif?id=20030317143025"

So wherever you reference your php page, just name it like so:

< a href="page.php?pid=< ?php print date() ? >" >

Does that work for you?
Computer thez nohhh...
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:57 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,