auto refresh pages?

D

Dave

Hi folks,

I have a few ASP pages that users have to go back and forth between for
various reasons. I'm finding that users have to hit refresh to see a most
resent query result. Is there a way to refresh a page when it first loads
rather than hit the browser cache?

Thanks,
Dave
 
H

homer

resent query result. Is there a way to refresh a page when it first loads
rather than hit the browser cache?

<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="never">
<meta name="revisit-after" content="30 Days">
</head>

Always overlooks cache? One article I read recommended building another
<head> and </head> at the base of the page, with these tags repeated, in
order to stump ISP server and crawler software buffer issues. Problem I had
with that, was that my html editor keeps removing the lower automatically.
homer
 
J

Joel Shepherd

Dave said:
I have a few ASP pages that users have to go back and forth between for
various reasons. I'm finding that users have to hit refresh to see a most
resent query result. Is there a way to refresh a page when it first loads
rather than hit the browser cache?

Are the users entering some information that affects the query result?
E.g., are they providing parameters that the query uses?

If so, the form should be submitted using POST, not GET.

If not, more information (like a URL to a page illustrating the problem)
would be nice to have.
 
D

David Dorward

homer said:
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="never">
<meta name="revisit-after" content="30 Days">
</head>

You would be better off using real http headers. Http equiv isn't really
equiv. :)

http://www.mnot.net/cache_docs/
Always overlooks cache? One article I read recommended building another
<head> and </head> at the base of the page, with these tags repeated, in
order to stump ISP server and crawler software buffer issues. Problem I
had with that, was that my html editor keeps removing the lower
automatically.

Good. The <head> element isn't allowed to appear after the <body>.
 
T

Toby Inkster

homer said:
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="never">
<meta name="revisit-after" content="30 Days">
</head>

Better yet, do it server-side. Here's my standard PHP non-caching code,
which should be pretty easy to adapt to VBS/ASP

// caching: Date in the past
header("Expires: Sun, 1 Jun 1980 12:00:00 GMT");
// caching: always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// caching: HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// caching: HTTP/1.0
header("Pragma: no-cache");
 
H

homer

This was being done in order to cause the memory buffer to fill, to get
past it, so that it would refresh. Dreamweaver4 took it, but the others
discard it.

homey
 
D

Dave

Data is being supplied via POST. I'd like to provide an example of where
the problem is occuring but it is in a secure area with Windows
Authentication.

Basically I want a page to load a fresh copy EVERY time it is loaded.

IE: I have a simple update form. User clicks a record to change. They
change it and then are brought BACK to the update form in the off chance
they should 1) wish to ensure the data was changed and 2) select another
record to change. However this selection page just loads the cached
version. You need to click refresh to see the changes.

Is there a meta/header tag which just forces a reload/refresh?
 
H

homer

Dave,

I've had problems with the refresh button not refreshing, especially on
Netscape. I actually had to delete the cached files to finally see the newer
page. I refreshed like 10 times, and saw only cache. Sounds like you might
need server side newly generated file names.
homey
 
T

Toby Inkster

homer said:
One article I read recommended building another <head> and </head> at
the base of the page, with these tags repeated, in order to stump ISP
server and crawler software buffer issues.

Then that article was stupid and you should forget you ever read it.
 
T

Toby Inkster

homer said:
The site is very reputable:

I don't care. The article is stupid. It recommends creating a dummy <head>
section in order to circumvent a bug with the Pragma pseudo-header that
was fixed in IE 4.01 service pack 2. How many people still use IE older
than that?

Besides which, from Microsoft's own mouth:

| Are you using Internet Explorer 4.01 Service Pack 2 or
| higher? There is no way to completely prevent caching in
| earlier versions of the browser.

http://support.microsoft.com/kb/234067/EN-US/

So this hack is futile. The Pragma problem was fixed in IE4.01sp2, and
it's not possible to prevent caching in earlier versions of IE.
 
D

David Dorward

homer said:
The site is very reputable

htmlgoodies has got a reputation alright ... it just isn't a good one. Its
packed full of invalid code that makes websites increasingly inaccessible
but that "looks cool" to newbies while teaching them incorrect technical
terms, non-cross-platform approaches and 1996 authoring techniques.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top