On 8/17/07 1:56 PM, "John Campbell" <[EMAIL PROTECTED]> wrote:

>> 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();
> }

How about setting the cache lifetime for each request to:
  mktime(0, 0, 0, date("m"), date("d")+1, date("Y")) - time();


_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to