• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

ASP loading form cache irritates me

I have one ASP with a button. After pressing the button, onclick event fires and sets window.location.href to another ASP page. That page should display data from the database, but it displays the old version of page with old data form IE's cache. How can I force the page to refresh after loading or how can I force it to always get the fresh data regardless what's in the cache?

Bocian...
0
Bocian
Asked:
Bocian
1 Solution
 
vendrigCommented:
Are you sure it's IE cache? Because there's a server cache as well. You can turn it off, but I can't tell you how at this moment. It's in the docs though, or maybe a kind soul here can tell you.
0
 
BocianAuthor Commented:
It's IE's cache because I can switch it off in Internet settings on my local computer. But I cannot rely on the fact that everybody will have this cache disabled. In most cases it's enabled. When i request the page as follows:
 http:// bla bla bla/mycleverpage.asp?param=value&param2=value2
and the same request is buffered, it is displayed from the cache with the old data, but the actual data has changed meanwhile...
0
 
Wiz_of_OzCommented:
to skip the cacheing of a page insert the following line into your HEAD section...

<meta http-equiv="PRAGMA" value="NO-CACHE">
0
 
bslavinCommented:
Or you can use:

<%Response.Expires = 0%>

Which will not allow the server to cache the page.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now