NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP caching (not opcode)

Damion Hankejh (ingk) d at ingk.com
Fri Jul 18 10:24:54 EDT 2008


This push cache concept has me intrigued.  

As to passing a request signature that encodes user agent, language, userid, etc. - can't this simply be added to the cache id (for instance with Cache_Lite)?  We've had great luck using pretty urls for caching db result set objects and embedding userid on the end of the url.

Damion Hankejh
www.ActiveCause.com 
www.InstantService.com 




-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of csnyder
Sent: Friday, July 18, 2008 9:25 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] PHP caching (not opcode)

On Thu, Jul 17, 2008 at 5:52 PM, Patrick May <patrick at ___.org> wrote:

> I'm working on a PHP cache library, and I wanted to check in and see what
> folks thought.
>

I love the idea of providing the cache with an event model, so that
you can fire events that invalidate the parts of the cache that are
listening for them. I haven't ever seen that before, but then again I
don't get out much. Is it derived from some other system/language?

The caches I've used and built are of the stock squid or apc
variety--they check on load to see if the cache is valid, and recreate
it if necessary. Call it "pull". What you propose (in part) is "push":
mark the cache as expired at action time, so that when a subsequent
request gets around to reading out the cached value it can already be
regenerated and ready to go.

One thing that would make this extremely useful (to me, anyway) would
be to have the methods pay attention to additional metadata besides
just the name of the cache. I would want to be able to also pass a
request signature: a string that encodes the user-agent, language,
content-type, and even the userid or sessionid, in both the cache and
break_cache methods.

Chris Snyder
http://chxor.chxo.com/





More information about the talk mailing list