Cache::BerkeleyDB(3)  User Contributed Perl Documentation Cache::BerkeleyDB(3)



NNAAMMEE
       Cache::BerkeleyDB -- implements the Cache::Cache interface.

DDEESSCCRRIIPPTTIIOONN
       This module implements the Cache interface provided by the Cache::Cache
       family of modules written by DeWitt Clinton. It provides a practically
       drop-in replacement for Cache::FileCache.

       As should be obvious from the name, the backend is based on BerkeleyDB.

SSYYNNOOPPSSIISS
         use Cache::BerkeleyDB;

         my $cache = new Cache::BerkeleyDB( { 'namespace' => 'MyNamespace',
                                              'default_expires_in' => 600 } );

         See Cache::Cache for the usage synopsis.

MMEETTHHOODDSS
       See Cache::Cache for the API documentation. Only changes relative to
       the standard methods are mentioned below.

       CClleeaarr(( [[$$ccaacchhee__rroooott]] ))
           See Cache::Cache, with the optional _$_c_a_c_h_e___r_o_o_t parameter.

       PPuurrggee(( [[$$ccaacchhee__rroooott]] ))
           See Cache::Cache, with the optional _$_c_a_c_h_e___r_o_o_t parameter.

       SSiizzee(( [[$$ccaacchhee__rroooott]] ))
           See Cache::Cache, with the optional _$_c_a_c_h_e___r_o_o_t parameter.

OOPPTTIIOONNSS
       See Cache::Cache for standard options.  Additionally, options are set
       by passing in a reference to a hash containing any of the following
       keys:

       _c_a_c_h_e___r_o_o_t
           The location in the filesystem that will hold the BDB files repre-
           senting the cache namespaces.  Defaults to /tmp unless explicitly
           set.

       _u_m_a_s_k
           The umask which will be active when any cache files are created.
           Defaults to 002. Note that this will have no effect on existing
           files.

PPRROOPPEERRTTIIEESS
       See Cache::Cache for default properties.

       ((ggeett||sseett))__ccaacchhee__rroooott
           Acessor pair for the option _c_a_c_h_e___r_o_o_t - see description above.

SSEEEE AALLSSOO
       Cache::Cache
       Cache::FileCache
       BerkeleyDB
       Cache::BerkeleyDB_Backend

TTOODDOO
       (1) The current version (0.03) uses the framework provided by the
       Cache::Cache family of modules quite heavily. In particular, it relies
       on Cache::BaseCache and Cache::Object for much of its functionality.
       This has obvious advantages; it means, however, that the extra speed
       gained by switching from the flat files of Cache::FileCache to a Berke-
       leyDB backend is much reduced compared with a top-to-bottom implementa-
       tion utilizing the latter's strengths to the full. Currently the speed
       gain relative to Cache::FileCache is in the range of 200% to 350%; I'm
       confident this can be increased significantly.

       (2) Since each cache namespace is represented as a separate BDB file,
       operating with (very) many namespaces in the same process may get you
       in trouble. While this has not been verified yet, it may make this ver-
       sion unsuitable for some uses, such as in an HTML::Mason environment
       under mod_perl. Future versions will probably implement multiple names-
       paces in the same file.

       (3) The current version is Unix-specific. That will probably change.

AAUUTTHHOORR
       Baldur Kristinsson <bk@mbl.is>, January 2006.

        Copyright (c) 2006 Baldur Kristinsson. All rights reserved.
        This program is free software; you can redistribute it and/or
        modify it under the same terms as Perl itself.



perl v5.8.7                       2006-02-02              Cache::BerkeleyDB(3)