[thelist] Server Side Prevent Caching of Old Pages?
J.D. Welch
so.there at showtunepink.com
Thu Apr 8 16:40:35 CDT 2004
on 8 Apr Bob Haroche wrote:
BH >Just finished a site re-design, including re-naming/mapping html
BH >pages. A number of visitors to the site are still seeing the old
BH >pages. If they clear their cache, they get the new pages.
BH >
BH >I know the tips to instruct end users to clear their cache, or type a
BH >bogus dynamic name (mydomain.com?abc), etc. to get the new content. Is
BH >there anything I can do server side, ie. putting something in an
BH >.htaccess file to force delivery of a non-cached page? The site is
BH >just html on a unix/apache host.
the easy (but possibly tedious) way is to insert lines like this into
the <head> section of pages:
<META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">
(change the date as appropriate)
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> (and/or)
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
with apache, you can use mod_expires and do all sorts of interesting
cache-control things. it might not be enabled; ask the server admin.
here's some interesting things on it:
http://httpd.apache.org/docs/mod/mod_expires.html
http://www.linuxdevcenter.com/pub/a/linux/2002/02/28/cachefriendly.html
since you mentioned static html, i'll only mention in passing that
php/jsp/asp/etc can send the appropriate http headers as well.
hth,
-jd
------------------------------------------------------------------
J.D. Welch | me at showtunepink.com
graphic designer | http://www.showtunepink.com
web monkey | http://kitschparade.ath.cx
------------------------------------------------------------------
More information about the thelist
mailing list