cache providers

18 views
Skip to first unread message

Joshua Paine

unread,
May 14, 2009, 10:55:29 PM5/14/09
to Recess Framework
If I've got APC enabled, should I leave Sqlite also enabled? What is
recess doing with the Sqlite-based cache when the APC one is also
enabled?

--
Joshua Paine
LetterBlock: Web applications built with joy
http://letterblock.com/
301-576-1920

Kris Jordan

unread,
May 15, 2009, 1:54:38 PM5/15/09
to recess-f...@googlegroups.com
Recess has at its disposal a basic implementation of "chain-of-responsibility" caching.

This is a design pattern the folks at Digg (http://www.krisjordan.com/2008/09/18/joe-stump-scaling-digg-and-other-web-applications/) use to simplify the looking up of cached data. The premise is you'd like to ask only one entity "do you have the value for this key" -- and it should check most locally first (so PHP's memory), then perhaps APC, then perhaps memcache, then hit the database.

For the purposes of how Recess' internals use cache and how the Cache Providers are currently implemented I would recommend against setting up this chaining and just use the best one you have available (so only APC). The reason is that the PDO connection to the Sqlite cache is not yet 
lazy (i.e. every request will load the PDO connection even if cached entries are in APC).

The chain-of-responsibility caching makes more sense when caching large lots of content, vs. Recess' internal data structures (i.e. routing).

-Kris
Reply all
Reply to author
Forward
0 new messages