On Tue, Sep 04, 2001 at 12:14:52PM -0700, Rob Bloodgood wrote:

> ***OH WOW!***  So, DURING the course of composing this message, I've
> realized that the function expire_old_accounts() is now redundant!
> Cache::Cache takes care of that, both with expires_in and max_size.  I'm
> leaving it in for reference, just to show how it's improved. :-)
>
> [snip]
> 
> use Apache::Session::Lock::Semaphore ();
> use Cache::SizeAwareSharedMemoryCache ();
> 
> # this is used in %cache_options, as well as for locking
> use constant SIGNATURE => 'EXIT';
> use constant MAX_ACCOUNTS => 300;
> 
> # use vars qw/%ACCOUNTS/;
> use vars qw/$ACCOUNTS $locker/;
> 
> my %cache_options = ( namespace => SIGNATURE,
>                       default_expires_in =>
>                         max_size => MAX_ACCOUNTS );


Very neat thought about how to use max_size to limit the the
accounts!  

Unfortunately, you demonstrated that I did a *terrible* job at
documenting what "size" means.

It means size in bytes, not items.

I will add max_items and limit_items to the TODO list.  In the
meantime, I will improve the documentation.

-DeWitt

Reply via email to