I am going to optimise a symfony (1.4) project by caching.
I don’t know what should I use? Is it better to cache whole pages, components, partial using symfony built-in cache or to cache sql results by APC? What are pros and cons for each one?
I am going to optimise a symfony (1.4) project by caching. I don’t know
Share
I would say: use both.
You can use
Doctrine_Cache_Apcfor all Doctrine queries, and use Symfony cache on complex actions/components.If you have a CMS, just remember to invalidate the cache so the user will see his editing “live”. For example, on a save action in the CMS, you can use
sfFileCache::removePatternto delete the cache files,then re-create cache files on-the-fly withsfWebBrowser::get.