[wp-hackers] Object Cache API and Persistent Object Caching

Ryan Boren ryan at boren.nu
Tue Nov 8 22:30:17 GMT 2005

On Tue, 2005-11-08 at 13:08 -0500, John Joseph Bachir wrote:
> On Mon, 7 Nov 2005, Ryan Boren wrote:
> > http://trac.wordpress.org/changeset/3011
> >
> > This introduces a new object cache API.  You can see the implementation
> > in the cache.php file.
> great stuff. just from initial clicking-around testing i'm seeing a 50% 
> reduction in queries per page.
> initial questions that come to mind (and this is before looking at the 
> code closely): is there now or in the future going to be file locking? 
> won't php processes then be in contention for the same files? isn't this 
> the sort of thing that databases are good at but php filesystem functions 
> are not?

Yes.  Doing it in the filesystem means you have to handle stuff the DB
takes care of.

> (i'm sure this has been thought of, just thowing that out to start some 
> discussion :)

We currently grab a semaphore if the sem functions are available
otherwise we flock().  We may need to drop the semaphore stuff and just
flock.  I'm not sure if the process context of sems is broad enough.


More information about the wp-hackers mailing list