Caching in Solar

Solar_Cache is a cousin to PEAR Cache_Lite, although most of the options have been made standard behavior.

Solar_Cache is itself a factory class; it builds and returns instances of Solar_Cache_Adapter, which has all the methods to interface directly with a backend container or adapter class that handles the actual storage or retrieval.

Solar_Cache comes with several adapters for caching data:

Although the configuration options for the adapters are slightly different, the API for each of them is identical (because the API is abstracted via the master Solar_Cache_Adapter class).

Limitations and Considerations

Because Solar_Cache is intended work exactly the same with every underlying adapter for it, there are some special considerations to take into account.

For example, the PEAR Cache_Lite class allows you to specify "groups" of caches through a single cache object; because the memcache adapter has no way of implementing that kind of function, it is not implemented within the file adapter either. However, the easy workaround it to have a separate Solar_Cache object for each "group" of caches you want to set up.

If you are on a shared system, you need to make sure the file adapter path is not shared between separate users or installations, otherwise the installations will "compete" with each other when entry keys are identical. The easy way to work around this is to not to use a system temp directory, and instead set up a directory specifically for caching.

 
manual/caching/overview.txt · Last modified: 2008/08/25 08:48 (external edit)