[Home]No cache

HomePage | RecentChanges | Preferences | Newbie Help

Category Design FAQ


Comments --

From the htmlhelp.com FAQ -- "The Pragma header is generally ineffective because its meaning is not standardized...."

Actually, while correct, this statement is misleading. What is not standardized, and probably never will be, is the use of the no-cache pragma in a HTTP response.

That's because the no-cache pragma is supposed to be part of a HTTP request. And this has been standardized since way way back when, e.g. Section 10.12 of RFC 1945 (the HTTP/1.0 spec), dated May 1996: http://www.faqs.org/rfcs/rfc1945.html

The way to advise a browser, or any "user agent" in general, not to cache a page is to send it with the appropriate HTTP headers, usually "Expires:" and maybe a few others - combinations are needed because there is no "popular" browser out there that is not broken in one way or another.

See Sections 13.2.1 and 13.13 (and the other sections they point to) in RFC 2616: http://www.faqs.org/rfcs/rfc2616.html

You can check your pages with the online service http://www.web-caching.com/cacheability.html which tries to test and estimate what caches will actually "think" about a page. It checks the HTTP headers sent by your server. (Jukka Korpela on alt.html 14.03.2002)


See also:


Call the page with a question-mark appended to the end of the URL. Instead of http://allmyfaqs.net/index.html use http://allmyfaqs.net/index.html?
Navigator will honor an HTTP Expires header with a value that has already passed --

Expires: Thu, 01 Jan 1970 00:00:01 GMT

-- Art Sackett -- Art Sackett Professional Web Design http://www.artsackett.com


Sid Ismail says --

Use all three - belt, braces and your hands:

Preventing a page being cached:

    <META HTTP-EQUIV="Expires" CONTENT="0">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">

IE is nasty about this. Try:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Pragma-directive" CONTENT="no-cache">
<META HTTP-EQUIV="cache-directive" CONTENT="no-cache">

If that doesn't work, append a random query string to the calling documents link.

<a href="/page_you_dont_want_cached.cgi?some_random_variable">

Consider this advice to be in the pragmatic, rather than the strictly proper category.

-- Jeff Thies


You can use a JavaScript-.Function that adds a dummy parameter to your request.

    example:
    location.href = "yourpage" + "?" + new Date().getTime();

This adds the current time in milliseconds to your request, and the page will be loaded every time.

-- On Wed, 4 Apr 2001 11:27:26 +0200, "Johannes Fitz" on comp.infosystems.www.authoring.html


HomePage | RecentChanges | Preferences | Newbie Help
This page is read-only | View other revisions
Last edited March 14, 2002 7:40 am (diff)
Search:

This FAQ is happily hosted by Betadome Digital Media