Permalink
Browse files

initial docs for caching

  • Loading branch information...
1 parent 680221c commit ef7934b48aa382025a47ca4073d9ff8661597d3b @lsmith77 lsmith77 committed Sep 23, 2012
Showing with 36 additions and 0 deletions.
  1. +1 −0 en/index.rst
  2. +35 −0 en/reference/caching.rst
View
@@ -14,6 +14,7 @@ Contents:
reference/class-loading
reference/annotations
+ reference/caching
Indices and tables
==================
View
@@ -0,0 +1,35 @@
+Doctrine Caching
+=================
+
+The Doctrine Common caching library was born from a need in the
+`Doctrine2 ORM <http://www.doctrine-project.org/projects/orm>`_ to
+allow caching of result sets. The library is independent and can be
+used in your own libraries to caching.
+
+Introduction
+------------
+
+Doctrine caching provides a very simple interface on top of which
+several out of the box implementations are provided:
+
+- ApcCache (requires ext/apc)
+- ArrayCache (in memory, lifetime of the request)
+- FilesystemCache (not optimal for high concurrency)
+- MemcacheCache (requires ext/memcache)
+- MemcachedCache (requires ext/memcached)
+- PhpFileCache (not optimal for high concurrency)
+- RedisCache.php (requires ext/phpredis)
+- WinCacheCache.php (requires ext/wincache)
+- XcacheCache.php (requires ext/xcache)
+- ZendDataCache.php (requires Zend Server Platform)
+
+.. code-block :: php
+
+ <?php
+
+ $cache = new \Doctrine\Common\Cache\ArrayCache();
+ $id = $cache->fetch("some key");
+ if (!$id) {
+ $id = do_something();
+ $cache->save("some key", $id);
+ }

0 comments on commit ef7934b

Please sign in to comment.