Forum Moderators: mack

Message Too Old, No Replies

Cached versions of web pages

         

kaulbr

4:54 pm on Feb 8, 2006 (gmt 0)

10+ Year Member



I do freelance web design and a lot of the times I ask my client to go to a page and view it for feedback. If it's the same page I asked them to review several days earlier, the second time they go back, they still see the cached old version of the page. They have to click refresh several times before the browser checks and pulls the new revised page. Is there something I can do on my end so this doesn't happen? Otherwise I have to explain to them how to clear their cache every time or ask them to "Please click refresh several times to make sure you are viewing the most recent version of the page" and I don't even know for sure if they are or if sometimes they may still not see 100% of the new changes. Any ideas for something I can do on my end.

httpwebwitch

7:56 pm on Feb 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



this [htmlgoodies.com] is a decent article that will help you.


<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

The article suggests that you put those tags at the beginning AND the end of your page, and explains why.

encyclo

1:33 am on Feb 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I wouldn't recommend using the tags twice in the document as recommended by that article. In fact those tags have a fairly limited effect: they have some influence on the browser cache but not necessarily on any intermediary web caches such as those used by ISPs - the latter don't parse the page content at all so any meta tags are ignored. The use of the tags as suggested is also invalid HTML.

The only way of disabling caching effectively is via HTTP headers which are sent with each page request. The exact way of setting them depends on the underlying technology of your web server: you can do it via a .htaccess file when using Apache, or via a scripting language (ASP on Windows platforms and PHP elsewhere).

Before you do so, you should ask yourself whether it is really necessary: web caching is a good idea for static pages as it increase load speed and reduces bandwidth usage. You can always ask the client to press Shift + F5 to fully refresh the page directly from the originating server.