Solved

How ensure that up-to-date pages are displayed, not cached ones ?

Posted on 2007-04-03
4
201 Views
Last Modified: 2013-11-19
Hi,

I am maintaining a website for my mother where she is displaying her paintings, www.taimiborg.se . It's a very small 'old-school' site that does not use cookies or any other things (at least not that I consciously implemented).

Yesterday I made an update to a page, Utställnignar/Upcoming exhibitions. I could see the new page immediately but some 12 hours later my mother called me and said she constantly got the old page.

It seems to me that it was a cache issue because when I told her to refresh the page the new one appeared.

I usually don't have problems like this since I have set the cache in all my browsers to small sizes and frequent clearing. However, there must be many users like my mother who don't really know what a cache is and why one can refresh a page, or clear the cache habitually.

Actually I thought that this was somewhat of a non-problem and that even if IE/Firefox/Opera has allowed cache sizes of 200mb (and thus will keep files for a long times before it automatically starts purging to make room for newer files), that once I close my browser and then restart it, when loading a page my browser will compare the cached page to the requested page. I thought this was normal cache behaviour of browsers, but the experience of my mother suggests otherwise.

So I wonder: when developing websites, what is the standard method for trying to ensure that a visitor is viewing the most up-to-date pages rather than some old cached ones on their harddrives? Should cookies be used for this? Or some meta-tag?

Please bear in mind that I am not a professional HTML programmer (obviously) so I appreciate pedagogical answers.

Thank you!
0
Comment
Question by:PierreDutronc
  • 2
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
JerSchneid earned 125 total points
ID: 18855549
This is obviously a bit browser specific, but I think the best you can do is include all the appropriate META tags to indicate that the page should not be cached (or cached for the desired amount of time)

Check out this page for some nice details:

http://www.i18nguy.com/markup/metatags.html

If you don't want it cached at all, include these tags:

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="expires" CONTENT="0">
0
 

Author Comment

by:PierreDutronc
ID: 18881222
Are those meta tags strictly only HTML ?

From browsing around I had got the impression that pragma and cache-control were dependent on PHP or something, or maybe some serverside programs...

(I don't know anything about PHP or serverside programs etc... I am looking for a pure HTML solution that can be specified inside the html document.)
0
 
LVL 2

Expert Comment

by:JerSchneid
ID: 18887543
Yes!  <META> tags are pure HTML.  They have nothing to do with PHP or any other server-side programming language.
0
 

Author Comment

by:PierreDutronc
ID: 18910623
Sorry to bother with another followup, but are there any downsides to specifying no-cache or expiry dates?

For instance, how do those tags interact with the google robot?

If I include the three tags above - or alternatively simply allow caching but specify expiry every 7 days even though the content is not likely to change that often - could this affect in any way how google indexes and ranks the site?

I am afraid the google-robot would see that I am forcing it to come back in vain and thus penalise me by dropping my ranking. It's a bit paranoid, but I guess it would actually be in Goole's interest to keep people from forcing the bot to come back when nothing has changed.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question