Changeset 11080
- Timestamp:
- 08/24/08 14:08:20 (3 months ago)
- Files:
-
- doc/branches/1.0/book/12-Caching.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
doc/branches/1.0/book/12-Caching.txt
r7417 r11080 204 204 foreach ($this->getParameter('pages') as $page) 205 205 { 206 $context->getViewCacheManager()->addCache($page['module'], $page['action'], array('lifeTime' => 86400));206 $context->getViewCacheManager()->addCache($page['module'], $page['action'], array('lifeTime' => 86400)); 207 207 } 208 208 } … … 242 242 >Alternative Caching storage 243 243 > 244 >By default, the symfony cache system stores data in files on the web server hard disk. You may want to store cache in memory (for instance, via memcache) or in a database (notably if you want to share your cache among several servers or speed up cache removal). You can easily alter symfony's default cache storage system because the cache class used by the symfony view cache manager is defined in `factories.yml`.244 >By default, the symfony cache system stores data in files on the web server hard disk. You may want to store cache in memory (for instance, via [memcached](http://www.danga.com/memcached/)) or in a database (notably if you want to share your cache among several servers or speed up cache removal). You can easily alter symfony's default cache storage system because the cache class used by the symfony view cache manager is defined in `factories.yml`. 245 245 > 246 246 >The default view cache storage factory is the `sfFileCache` class: … … 252 252 > cacheDir: %SF_TEMPLATE_CACHE_DIR% 253 253 > 254 >You can replace the `class` with your own cache storage class or with one of the symfony alternative classes (`sfSQLiteCache` for instance). The parameters defined under the `param` key are passed to the `initialize()` method of your class as an associative array. Any view cache storage class must imple - ment all methods found in the abstract `sfCache` class. Refer to the API documentation ([http://www. symfony-project.com/api/symfony.html](http://www.symfony-project.com/api/symfony.html)) for more information on this subject.254 >You can replace the `class` with your own cache storage class or with one of the symfony alternative classes (`sfSQLiteCache` for instance). The parameters defined under the `param` key are passed to the `initialize()` method of your class as an associative array. Any view cache storage class must implement all methods found in the abstract `sfCache` class. Refer to the API documentation ([http://www.symfony-project.com/api/symfony.html](http://www.symfony-project.com/api/symfony.html)) for more information on this subject. 255 255 256 256 ### Using the Super Fast Cache … … 391 391 >When you start using the HTML cache, you need to keep a clear view of the dependencies between the model and the actions, so that new errors don't appear because of a misunderstood relationship. Keep in mind that all the actions that modify the model should probably contain a bunch of calls to the `remove()` method if the HTML cache is used somewhere in the application. 392 392 > 393 >And, if you don't want to damage your brain with too difficult an analysis, you can always clear the whole cache each time you update the database . ..393 >And, if you don't want to damage your brain with too difficult an analysis, you can always clear the whole cache each time you update the database... 394 394 395 395 ### Cache Directory Structure