Solved

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

Posted on 2007-04-03
4
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

617 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