News Feed
Sections




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

Master Zend Framework:
Easy Cache Configuration With StorageCacheAbstractServiceFactory
August 07, 2014 @ 14:46:54

The Master Zend Framework site has posted a tutorial centered around caching in Zend Framework 2 applications. In this new post Matthew Setter looks at using the StorageCacheAbstractServiceFactory to handle the configuration and management of caching. The method is already implemented in the skeleton ZF2 application, so it makes it even easier to get started.

If you've been playing with Zend Framework 2 for some time, specifically the ZF2 Skeleton Application, you still may not have come across some of the pre-registered service manager abstract factory options. As I was browsing through the Application module's module.config.php recently, I came across this snippet [setting up the StorageCacheAbstractServiceFactory]. It was at that point I wondered why I'd spent time setting up caching using other methods, when this approach was already there and seemed to do a lot of the heavy lifting for me. So in this week's tutorial, I'm going to take you through how to use it, working with the default configuration provided in the manual.

He shows how to update the default configuration for the caching service including the caching type (the technology) and the configuration options to use. He mentions the kinds of caching available and provides a more "real world" example. This example uses the Laravel Homestead VM and a simple Redis server as the caching datastore. He sets up the configuration and shows how to access the caching service in both the controller and via dependency injection. He finishes off with a few lines of code showing how to use the caching to check for an item and, if not found, add it to the dataset.

0 comments voice your opinion now!
zendframework2 tutorial cache configuration storagecacheabstractfactory

Link: http://www.masterzendframework.com/servicemanager/storage-cache-abstract-service-factory-easy-cache-configuration

blog comments powered by Disqus

Similar Posts

Stefan Mischook's Blog: Object Oriented PHP Tutorial in PDF

SitePoint PHP Blog: Understanding Symfony Bundle Configuration and Service Container

Lorna Mitchell's Blog: Building A RESTful PHP Server: Output Handlers

Rafael Dohms' Blog: Debugging PHPUnit Tests in NetBeans with XDebug

Chris Jones: Offline Processing in PHP with Advanced Queuing


Community Events





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


community symfony library framework podcast interview package series update introduction api list zendserver opinion laravel tips release language install deployment

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