Re: How does caching work?
| From: | Daniel Brown | Date: | Tue, 09 Jun 2009 20:44:59 +0000 |
| Subject: | Re: How does caching work? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-293820@lists.php.net to get a copy of this message | ||
On Tue, Jun 9, 2009 at 16:35, Paul M Foster<paulf@quillandmouse.com> wrote:
>
> But if a page is populated with variables from a database (for example)
> which could change from time to time, how could a caching engine
> possibly cache it? How would it determine whether to re-fetch the page
> or use the cached version?
This is more a matter of the HTTP protocol and HTML standards.
Check into meta (pragma) 'no-cache' tags and Google "cache control"
for the basics on this.
Thankfully, (at least most) clients do not check the full page to
see if there's an updated version --- because if they did, they may as
well display it, as they'd use up the network, server, and a portion
of the client resources in doing so. Instead, they check the cache
expire time and/or compare the local (cached) copy against the
timestamp of what the server says for the file's "last-modified" stamp
- known as a file's 'mtime' data.
If I've somehow circumlocuted your question, ignore me and pretend
I was never here. ;-P
--
</Daniel P. Brown>
daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000