473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Cache for 24 hours since first access?

I've searched for days for an answer to this question; I hope someone
can help. I want to make sure that my web content is reasonably current,
but at the same time I don't want to bypass caching completely.

I'm looking for a way to cache a page for 24 hours after a user accesses
it, but if they come back after that time, then reload the page.

I understand using HTTP headers, rather than META tags, is the best way
for maximum compatibility.

I've seen a few scripts in something called PHP, but I don't think I can
use this on my site.

Can anyone help, or offer an alternative?
--
Nige

Please replace YYYY with the current year
ille quis mortem cum maximus ludos, vincat
Jul 20 '05 #1
6 2260
Nige wrote:
I'm looking for a way to cache a page for 24 hours after a user accesses
it, but if they come back after that time, then reload the page.

I understand using HTTP headers, rather than META tags, is the best way
for maximum compatibility.
Correct.
I've seen a few scripts in something called PHP, but I don't think I can
use this on my site.
What does your host support?
Can anyone help, or offer an alternative?


What have you found so far? What does your host support? What kind of
software is you site driven by?

The information you give it to minimal to give a correct answer IMHO.

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #2
On Tue, 18 Nov 2003, Anne van Kesteren wrote:
Nige wrote:
I'm looking for a way to cache a page for 24 hours after a user accesses
it, but if they come back after that time, then reload the page.
[..] What have you found so far? What does your host support? What kind of
software is you site driven by?


Fair points, but maybe a preparatory read of
http://www.mnot.net/cache_docs/ would give the O.P a better
context in which to ask the question.

Jul 20 '05 #3
In comp.infosystems.www.authoring.html, Alan J. Flavell wrote:
http://www.mnot.net/cache_docs/ would give the O.P a better
context in which to ask the question.


I had actually read this, but since posting I've realised that HTTP
headers are sent by the server. I've contacted my host.

In the meantime, I'm using:

<head>
<META Http-Equiv="Cache-Control" Content="max-age=3600,
must-revalidate">

....
</head>
--
Nige

Please replace YYYY with the current year
ille quis mortem cum maximus ludos, vincat
Jul 20 '05 #4
Nige <uY***@ntlworld.com> writes:
<META Http-Equiv="Cache-Control" Content="max-age=3600,
must-revalidate">


3600 isn't 24 hours, by the way.

--
Chris
Jul 20 '05 #5
Nige <uY***@ntlworld.com> writes:
I've searched for days for an answer to this question; I hope someone
can help. I want to make sure that my web content is reasonably current,
but at the same time I don't want to bypass caching completely. [...] I've seen a few scripts in something called PHP, but I don't think I can
use this on my site.


Are you creating scripts, or normal HTML pages? If scripts, what
language?

If normal HTML pages, any sane web server will automatically send a
Last-Modified header for your page. If you're updating your page every
day, caches will re-check it at least daily.

Some web servers send unnecessary cookies, thus defeating shared
caches. You can check your page at the following URL:

http://www.ircache.net/cgi-bin/cacheability.py
Jul 20 '05 #6
In article <of********************************@4ax.com>,
Nige <uY***@ntlworld.com> wrote:
I've seen a few scripts in something called PHP, but I don't think I can
use this on my site.

Can anyone help, or offer an alternative?


In Apache .htaccess (if allowed):

ExpiresActive On
ExpiresDefault "access plus 24 hours"

http://httpd.apache.org/docs/mod/mod_expires.html

--
Henri Sivonen
hs******@iki.fi
http://iki.fi/hsivonen/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Bill H | last post by:
I have a routine that displays 60 items (with thumbnails) per page. You can click any item and displays a new page with item details. When the user back pages it runs the query again to display all...
5
by: Alex | last post by:
Hi all, We're looking at a vendor who uses the InterSystems Cache Database Platform, but our IT department has zero experience with this system. This software package will have a pivotal and...
1
by: Tony Hsieh | last post by:
Hi, So I have a asp page that displays the results of a database query that takes 3 minutes to run. I want to cache this dataset for 10 hours so I don't have to perform the 3 minute query every...
4
by: Erick | last post by:
i have an asp.net application and I want to save the results of an sql query in cache. Because the queries take 28 seconds to run (there are twelve similar queries) I want to run it all at 4am, ...
0
by: bthomas71chevy | last post by:
(I hope I can explain this correctly and someone can clarify it and or correct me if I'm wrong?) After a Build of a Web App and deployment, each pages server cache is dropped and that is why the...
11
by: EagleRed | last post by:
I am writing an ASP.NET 2.0 application that uses master pages. I have some pages that must not be cached on the client. In ASP.NET 1.1 I achieved this using metatags: <meta...
2
by: Don | last post by:
I've come across a weird behaviour with regards to the cache object. I couldn't find any documentation which could explain this. Basically the problem has to do with the cache item NOT expiring....
1
by: mk | last post by:
I need to host a cache of readily available information. This data will change dynamically during the day, but is likely to be fresh for up to three or four hours. I intend to expose a remoting...
1
by: webbo | last post by:
Guys, I'm currently in the design stages of a small application that will gather information from external sources and cache the responses for 12 hours or so. Obviously, the cache will need...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.