Not PHP, but in my Django cms I used memcached, for each request I use a
middleware (like a filter function which each request goes through),
that creates an MD5 of the page content and a time stamp when that MD5
hash was created.  I store the URL, MD5 of last content, and the time
stamp in the cache so each entry takes very little RAM.  The middleware
also sets the Etag to the MD5 and last modified HTTP header for each
outgoing page to that time stamp.

When you revisit a page still in the cache, it sends the same Etag and
last modified headers, which produces a 304 not modified, and the
browser won't re-download the page.

This won't save on processing time, but it can save on bandwidth, and
maybe a little bit of time on the client side especially if they have a
slower connection.

Whether its practical, I don't know, but the overhead seems to be
unnoticeable anyway, so to me these bandwidth savings are worth it. 

On Sun, 2008-10-12 at 13:10 +1300, Craig Cochrane wrote:
> Hi Guys
>  
> Just researching Caching pages, this looks basic. Is this good
> practice? Would be interested in feedback on this subject.
>  
> Craig
> 
> --~--~---------~--~----~------------~-------~--~----~
> NZ PHP Users Group: http://groups.google.com/group/nzphpug 
> To post, send email to [email protected] 
> To unsubscribe, send email to 
> [EMAIL PROTECTED] 
> -~----------~----~----~----~------~----~------~--~---
> 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to