Forum Moderators: open

Message Too Old, No Replies

IE and header caching - anybody know how to stop it from doing so?

ie seems to be caching a 302 redirect and i need it to stop

         

jeremy goodrich

6:05 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



At work, I only have IE -> so I'm a bit handicapped. I've got a script I'm debugging, which gives a 302 redirect on a certain condition.

I changed the script to redirect someplace else, but IE cached the 302 response, and isn't pulling the new header info from the script (as it should...I don't see why it should cache something like this).

Browser related nightmares are NOT my forte, anybody have any ideas on how to force IE not to cache my script header?

1) can't switch broswers
2) need IE to stop caching the header from the script.

Any help greatly appreciated.

pageoneresults

6:58 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Jeremy, I'm not sure if I'm on target here, but try using Ctrl + Refresh while viewing the page with the script. That will bypass cache and give you the real thing.

jeremy goodrich

6:59 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



:( That won't work, since it is a server side redirect based on some environment variable & cookie checking.

Any other ideas?

digitalghost

7:01 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tools >Internet Options > Delete Files
Tools >Internet Options > Clear History

?

jeremy goodrich

7:08 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope, that one didn't work either. Very strange.

Back to debugging on the original server, anyway -> I ended up porting the script to another location on the 2nd server, this time remembering to reconfigure it before checking it in the browser, and I still got the erros I expected from running it on the first (original) server. :(

I hate debugging - thanks for the help.

moltar

7:13 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can add some random strings to your script at the end that won't affect it almost in anyway.

Something like this: script.pl?cachehack=12345

and just vary the 12345 to whatever.. everytime u want to have fresh headers.

If you already have something in the query string, then just add it with &

Something like this: script.pl?yourname=yourvalue&cachehack=12345

Hope that helps.

pageoneresults

7:19 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Couldn't you just drop a META Expires tag into the page that you are testing?

<meta http-equiv="expires" value="Mon, 14 Jul 2003 00:00:01 gmt">

If you set the expiration date to the past, IE is forced to call the server for new content. I believe that is how it works.

jeremy goodrich

7:21 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That seems like it would be a client side solution and the problem is that IE is caching the head portion of the web page. There is no body of the page I'm calling, just a head / environment check & cookie check.

>>>add a rand value

That didn't work, either :( Going to check with some network folks here to see if there is an issue with our coporate set up that would cache a response like that too.

moltar

7:33 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the random value doesn't work, then It's something really wrong.

Adding new strings at the end makes it a new document and IE has no right in any case to cache headers.

Maybe It's something in your script?

jdMorgan

7:37 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Jeremy,

You can have your script add a cache-control header to the response, or you can set up the server to do it. Either way, the header should be 'Cache-Control: "no-cache, must-revalidate"' to prevent this problem.

Changing you internet settings to force IE to get the page from the server every time is a quick-fix, but won't prevent your users from having the same problem you're having. The setting is under: Internet Options->Temporary Internet files->Settings->Check for newer version of stored pages: Every visit to the page

Jim