Please help me limit caching

  • Thread starter James Dow Allen
  • Start date
J

James Dow Allen

I have my own hobby website
http://fabpedigree.com
Most of the pages change about once per month.
When I access it myself with Firefox I often get old versions.
(I can click Refresh, of course, if I notice this,
but I worry about others accessing the site; they'd have
the same problem but not even know it.)
I realize I can add a 'NO-CACHE' directive on each page,
or in a .htaccess file, but that seems like overkill.
I don't want to degrade access speed. It would be
inconvenient to add EXPIRES directives to the html
pages, as I don't know in advance when the page will
be obsoleted.

I wish there were a .htaccess or html directive like
"Don't keep any cached pages for more than a week."
How do others handle this issue?

My ignorance of html, etc., is rather thorough, so any comments
on elementary ideas I'm overlooking are welcome.

James Dow Allen
 
H

Hot-Text

James Dow Allen said:
I have my own hobby website
http://fabpedigree.com
Most of the pages change about once per month.
When I access it myself with Firefox I often get old versions.
(I can click Refresh, of course, if I notice this,
but I worry about others accessing the site; they'd have
the same problem but not even know it.)
I realize I can add a 'NO-CACHE' directive on each page,
or in a .htaccess file, but that seems like overkill.
I don't want to degrade access speed. It would be
inconvenient to add EXPIRES directives to the html
pages, as I don't know in advance when the page will
be obsoleted.

I wish there were a .htaccess or html directive like
"Don't keep any cached pages for more than a week."
How do others handle this issue?

My ignorance of html, etc., is rather thorough, so any comments
on elementary ideas I'm overlooking are welcome.

James Dow Allen

Pass on:: IE8SP2
Pass on:: Sarfari 5.1.6
Pass on:: Opera/9.80
Pass on:: FireFox 10.2
pass on:: Mozilla 1.7.2
 
J

Jukka K. Korpela

2012-10-08 10:02 said:
I have my own hobby website
http://fabpedigree.com
Most of the pages change about once per month.

Check out
http://redbot.org/?uri=http://fabpedigree.com
for a quick cacheability analysis. Browsers will make their own
analysis, mainly based on the Last-Modified header.
When I access it myself with Firefox I often get old versions.

This is a common fallacy among authors. At present, when Last-Modified
means that the page was modified a few days ago, browsers probably treat
it as cacheable for some minutes, or maybe a few hours. Now, as an
author, you may have opened the page in a browser, perhaps closed the
browser, edited the page, and then open it again. The browser will use
the cached copy, for apparent reasons. What are the odds that this
happens to a casual surfer?
It would be
inconvenient to add EXPIRES directives to the html
pages, as I don't know in advance when the page will
be obsoleted.

EXPIRES means that the cached copy will be treated as stale. This is
something you do on the basis of estimates and guesses, not exact
computation of the future.
I wish there were a .htaccess or html directive like
"Don't keep any cached pages for more than a week."

There are no directives in HTML.

But there is such a directive in Apache, see
http://httpd.apache.org/docs/2.2/mod/mod_expires.html
By setting
ExpiresByType text/html "access plus 7 days"
you are effectively imposing an upper limit on the lifetime of a cached
copy of any HTML document.
 
H

Hot-Text

Jukka K. Korpela said:
Check out
http://redbot.org/?uri=http://fabpedigree.com
for a quick cacheability analysis. Browsers will make their own
analysis, mainly based on the Last-Modified header.


This is a common fallacy among authors. At present, when Last-Modified
means that the page was modified a few days ago, browsers probably treat
it as cacheable for some minutes, or maybe a few hours. Now, as an
author, you may have opened the page in a browser, perhaps closed the
browser, edited the page, and then open it again. The browser will use
the cached copy, for apparent reasons. What are the odds that this
happens to a casual surfer?


EXPIRES means that the cached copy will be treated as stale. This is
something you do on the basis of estimates and guesses, not exact
computation of the future.


There are no directives in HTML.

But there is such a directive in Apache, see
http://httpd.apache.org/docs/2.2/mod/mod_expires.html
By setting
ExpiresByType text/html "access plus 7 days"
you are effectively imposing an upper limit on the lifetime of a cached
copy of any HTML document.

Good answer with good Info..........
 
J

James Dow Allen

ExpiresByType text/html "access plus 7 days"

Thank you muchly. This is exactly what I was looking for!
(I'm going with "3 days" instead of 7.)

I see lots of Google hits for "ExpiresByType" but no mention
of this option if I Google ".htaccess tutorial" or such.

This is the 2nd or 3rd time I've had quick useful responses
here for my website questions. Maybe I should visit here
more often. :)

James
 
H

Hot-Text

James Dow Allen said:
Thank you muchly. This is exactly what I was looking for!
(I'm going with "3 days" instead of 7.)

I see lots of Google hits for "ExpiresByType" but no mention
of this option if I Google ".htaccess tutorial" or such.

This is the 2nd or 3rd time I've had quick useful responses
here for my website questions. Maybe I should visit here
more often. :)

James

Good to see your questions.
If the Answer was not HTML,
Then it have to bing.com Hot-Text.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top