NYCPHP Meetup

NYPHP.org

[nycphp-talk] Cache package suggestions

John Campbell jcampbell1 at gmail.com
Fri Aug 17 13:56:31 EDT 2007


> I received offline regarding the midnight issue is to dynamically
> calculate the lifetime to midnight for each request. But this does add some
> calculation overhead for each request.

A common solution to this class of problem, is to only run the routine
if the request draws the unlucky lottery number... for example the
default PHP session garbage collection routine operates like:

if(rand(0,100) == 42) {
cleanup_expired_sessions();
}

-John Campbell



More information about the talk mailing list