PDA

View Full Version : Problem with IE/Netscape cache and (possibly) PHP


robbie
10-21-2000, 06:43 AM
Hi there,

I have been having strange problems with IE and Netscape (versions 5 and 4.x respectively) on my PHP site.

The problem is that both browsers refuse to reload new images I upload to the server. I have tried different combinations of cache/proxy/temporart internet files settings but there's no difference! New php or html files do reload once I Control+Refresh in IE or refresh twice in Netscape.

Has anyone encountered this problem, or know of a solution for it?

Thanks!

Terra
10-21-2000, 07:16 AM
Just for the sake of insanity, rename that image to something bogus like:
image.gif --> image.gif.offline

Then reload the page, if the image still loads then something is not quite right...

Possible problems:
1) You uploaded the image to the wrong directory
2) You named the file incorrectly (CaSe maTTerS)
3) You have one very aggressive caching proxy that your sitting behind, most likely your ISP's because we don't run caches...
4) Your browser is schizophrenic and needs to be analyzed

There are a multitude of more reasons, but usually become more moronic from here...[nbsp][nbsp]Many times it's the 'Duh' factor, which makes itself apparent after walking away from it - then it hits you like a two-ton heavy thing...

If you have tried with 2 different browsers, then I'm leaning towards Item one through three...

Best of luck...

--
Terra
--Looking for something that doesn't exist really does make sense--
FutureQuest

PaulKroll
10-21-2000, 03:31 PM
Aside from proxies, IE is "very aggressive" with its caching, and one of the things that it looks for is the Expires date on pages/graphics. By default, apache doesn't send any expires dates, but you can add them via .htaccess. See the apache docs at http://www.apache.org

You don't, you really don't, want to make the Expires date short for all your graphics: caching is not an enemy, it's a friend. If you have certain graphics that MUST change, put them in a different directory than your "normal" stable graphics, and don't just have short Expires dates: create the graphics with a new filename/URL. That way, even if a graphic is STILL cached, as long as the HTML/PHP page is fresh, it'll point at the new, correct graphics. (Making HTML pages fresh is another Expires thing, and again, you don't want them all to have short Expires. PHP scripts are a different matter: You need to send Expires dates from within PHP, not set in .htaccess, and you probably DO want short Expires times for most PHP pages.)

Lastly, Terra's suggestion that you could be behind a caching proxy is an all-out given if you're on AOL. AOL has a very interesting page or two about its[nbsp][nbsp]network at http://www.aol.com, near the bottom, click on "Webmaster Info". On the webmaster.info page, you'll find links to "Network Info" which will tell you AOL's cache will: recompress images unless users specifically reset that feature, cache up to 24 hours if the object (picture/page) does not contain an explicit Expires setting, and that the "META" settings in html pages will NOT have an effect.[nbsp][nbsp]It's actually quite a nice set of pages for figuring out how to deal with them, or with any ISP that uses aggressive proxy caching. :)
[This message has been edited by PaulKroll (edited 10-21-00@2:33 pm)]

Dan Kaplan
10-22-2000, 01:02 AM
Another common one I've seen is when the images are used as JavaScript mouseover's; a forced refresh often is not sufficient.[nbsp][nbsp]In that case, closing and restarting the browser is usually necessary (not good if you have people visiting and seeing a mix of old and new or just old :( ).

Dan