Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE cache problem, but not in NS 3

Status
Not open for further replies.

Ovatvvon

Programmer
Feb 1, 2001
1,514
US
This is a problem I encounter with Internet Explorer only, not netscape. I've tryed reinstalling IE 5.5, and have upgraded to 6.0, but it still doesn't fix the problem.

Whether I am interacting with databases, or cookies, the page (within I.E.) will not update to show the latest information change.

It's not just my I.E. because I've also tried it from another computer using IE down on base. I've set the browser to update with every visit to the page, and even set the cache saving option to the minimum setting of 1 MB. Within my code I've used the following on every page. And nothing seams to fix the problem, however NS works fine.

<%
Response.Expires = 0
Response.ExpiresAbsolute = #January 1, 2000 00:00:00#
Response.AddHeader &quot;pragma&quot;,&quot;no-cache&quot;
Response.AddHeader &quot;cache-control&quot;,&quot;private&quot;
Response.CacheControl = &quot;private&quot;
%>

(have also tried substituting Response.ExpiresAbsolute value with now()-2 and yet it still does not effect it in any way.


Does anyone have any idea what is causing this?
-Ovatvvon :-Q
 
we're running a clustered server environment and ran into a similar issue. it turned out not to be the browser but the server that was caching. when the servers failed from one to the other, the one that had just gotten control would display what was the most current page from the last time it had been in control (which was not the most current). our IS guys added a script to both servers to clear the cache upon accepting control and the problem went away. don't know what your environment is like but...maybe that's something for ya' to look into.
hth
mb
 
Not using clustering here. Any other suggestions or ideas? -Ovatvvon :-Q
 
Dare to suggest: delete all files in the Temporary Internet Files and see if it helped.
 
Many different behaviors when trying to prevent cache. The only sure fire way is to append a unique string to the end of every URL you are linking to in your web pages. I do that and never have to worry about cache prevent headers or anything like that.

Try this at the top of every page.
Code:
dim uUrl
uUrl = &quot;uUrl=&quot; & Date & Timer

Then on every URL in your web page, simply add this to the end.
Code:
somepage.asp?<%=uUrl%>
Every URL will be different and will never be pulled from any cached files.

ToddWW
 
Ovatvvon,

Try this code in your html part of the document.

I had EXACTLY the same problem as you with IE & NS and this fixed it fine.

Just make sure that you add this code to all pages affected.


<head>
<title>...</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<meta http-equiv=&quot;Pragma&quot; content=&quot;no-cache&quot;>
<meta http-equiv=&quot;Cache-Control&quot; content=&quot;no-cache&quot;>
<meta http-equiv=&quot;Expires&quot; content=&quot;0&quot;>
...
</head>
 
guestg
I did try deleteing all the temp files...it worked for the first visit after that and that's it.

ToddWW
with that method, wouldn't the url end up growing with every visit to another page? Wouldn't it keep adding more and more date and time id's? that means more data having to be transfered plus the url can only up up to 255 characters long.

LesleyW
I tried that along with Response.ExpiresAbsolute = #January 1, 2000 00:00:00#
to which neither one worked.

Zipster
I tried that only on the server side as in the first comment I wrote on the page. I used:
<%
Response.Expires = 0
Response.ExpiresAbsolute = #January 1, 2000 00:00:00#
Response.AddHeader &quot;pragma&quot;,&quot;no-cache&quot;
Response.AddHeader &quot;cache-control&quot;,&quot;private&quot;
Response.CacheControl = &quot;private&quot;
%>
Are you saying it will act different if using the client side version and not the server side version?

-Ovatvvon :-Q
 
Ovatvvon,

ToddWW's solution is the 100% way to ensure a no-cache load. the url will not keep growing... it will always be the same length, but the key is that it will be different each time a page is requested, which is the key to making the server serve up a fresh version of the page.
penny.gif
penny.gif
 
Relooked at ToddWW's message. I looked at it before and thought it said:

dim uUrl
uUrl = uUrl & Date & Timer

ok, I'll do this then.

Thanks for your imput everyone! -Ovatvvon :-Q
 
Not sure what the results would be, but
Code:
dim uUrl
uUrl = uUrl & Date & Timer
Might produce a funny result. I use this..
Code:
dim uUrl
uUrl = &quot;uUrl&quot; & Date & Timer
Now I can see why you initially thought that the URL would continue to grow. I shouldn't be using the same name for the VBScript variable and the QueryString variable. But nonetheless, if you do it like I do, the URL will not grow. On your server side code, your links will look like this.
Code:
somepage.asp?<%=uUrl%>
someotherpage.asp?someVar=someValue&<%=uUrl%>
Notice when you append the <%=uUrl%> at the end of one or more existing query string variables, you need to put an ampersand there.

When you serve that page up to a browser. View source would show those links to look like this.
Code:
somepage.asp?uUrl=1/18/200243314.33
someotherpage.asp?someVar=someValue&uUrl=1/18/200243314.33

Reload the page and it will look something like this.
Code:
somepage.asp?uUrl=1/18/200243321.16
someotherpage.asp?someVar=someValue&uUrl=1/18/200243321.16

Hope that clears things up.

ToddWW
 
Yeah, I understand how all the querystring's work...just mis-read your first message. Thanks for all the help! I'm just gonna have to resort to that...don't know why the I.E. is acting the way it is...until now I've liked it a lot better than NS.
-Ovatvvon :-Q
 
Wonderful ToddWW.. Very interesting logic.

Do you have any more such hidden tricks up in your sleeves ? Thank you...
RR

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top