NYCPHP Meetup

NYPHP.org

[nycphp-talk] DBM file support and caching in PHP

mark mark at thirdstation.com
Thu Dec 16 10:19:02 EST 2004


Greetings,

I am porting a library from Perl to PHP that will provide an API to perform over-the-network lookups 
of information.

The network lookups can potentially take a long time so, I'd like to cache results locally in a DBM file.  
>From what I've discovered so far, DBM file support is not enabled by default and must be compiled 
into the php binary.  Because I'd like the library to be easy to install, basically just untar it and go, I 
want to avoid asking my customers to recompile their php installations.

I also don't want to ask that the customers use their own DB's for caching because I don't want them 
to know anything about the cache (other than the fact it's there).  It's internal to the library.

Does PHP offer any built-in mechanisms to cache data?  I was going to serialize PHP objects out to 
the DBM file.  I'd use a flat file but, I need the fast lookup that DBM gives.

Any suggestions, wisdom?  Any info will be greatly appreciated.

Thanks,
Mark




More information about the talk mailing list