News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Michael Nitschinger's Blog:
Caching responses in Lithium
May 30, 2011 @ 10:28:05

Michael Nitschinger has put together a guide to caching responses in the Lithium framework - a simple update that means your application dosen't even need to reach the controllers to do its job.

I've hacked together a small example on how to easily cache full responses in Lithium. If you need to cache full Response objects in Lithium (which means that your controllers don't even get called when there's a cache hit), you can place this in your app/config/bootstrap/cache.php file (note that this is certainly not "production ready", but it should give you a starting point).

The code adds a new filter to run on execute that takes the current object (the Response object hit the first time) and use the Cache functionality to push it into storage. Their cache key is based on the URL, so each requests is cached individually. You can find out more about filters and the framework at Lithify.me.

0 comments voice your opinion now!
lithium framework cache response


blog comments powered by Disqus

Similar Posts

ThisLab: Notes on Choosing a PHP Framework: A Quick Comparison of CodeIgniter and Kohana

SaniSoft Blog: unbindModel() and paginate() gotcha in CakePHP 1.2

PHPClasses.org: Book Review - PHP 5 CMS Framework Development - 2nd edition (Packt)

Symfony Blog: Who Wants a Free Web Application?

PHPMaster.com: Living Apart Together: Decoupling Code and Framework


Community Events





Don't see your event here?
Let us know!


laravel introduction interview threedevsandamaybe api zendserver code release conference development deployment tips framework podcast symfony language community series list bugfix

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework