Recommend this page to a friend! |
Classes of Gjero Krsteski | PIMF | manuscript/8c. Cache configuration.md | Download |
|
DownloadCache configurationPIMF's caching makes it simple. PIMF provides following cache storages out of the box:
By default, PIMF is configured to use the file system cache storage. It`s ready to go out of the box with no configuration. The file system storage stores cached items as files in the cache directory. If you're satisfied with this storage, no other configuration is required. File system cache is stored in the app/YourAppName/_cache/ directory, so make sure it's writeable. You're ready to start using it.
Database StorageThe database cache storage uses a given database table as a simple key-value store. To get started, first set the name of the database table in config.app.php. Once your configuration and table is setup, you're ready to start caching! To start using database sessions, you will first need to configure your database connection. Next, you will need to create a session table. However, you may also use PIMF's command-line to generate the table for you!
Memcached StorageMemcached is an ultra-fast, open-source distributed memory object caching system. Before using PIMFS's Memcached storage, you will need to install and configure Memcached and the PHP Memcache extension on your server. Once Memcached is installed on your server you must set the storage in the config.app.php file. Redis StorageRedis is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, and sorted sets. Before using the Redis cache storage, you must configure your Redis servers. Now you can just set the storage in the config.app.php file. DBA StorageThe DBA is ultra-fast storage that uses the database (dbm-style) abstraction layer to cache/store your PHP objects, strings, integers or arrays. You don`t have to matter about the size of the cache-file. It depends on the free space of your disk. You have to compile your PHP –enable-dba=shared and –with-[qdbm|flatfile|db4] before using it. In-Memory StorageThe memory cache storage does not actually cache anything to disk. It simply maintains an internal array of the cache data for the current request. This makes it perfect for unit testing your application in isolation from any storage mechanism. It should never be used as a real cache storage. |