NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP caching (not opcode)

csnyder chsnyder at gmail.com
Fri Jul 18 09:24:51 EDT 2008


On Thu, Jul 17, 2008 at 5:52 PM, Patrick May <patrick at hexane.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