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

NetTuts.com: Expressive Tests with Hamcrest

HowTo Forge: Intrusion Detection For PHP Applications With PHPIDS

TrueLogic.org: Integrate the Mailchimp API with your PHP application

DevShed: Building a Blogger with the Code Igniter PHP Framework

PHP Web Services: How to configure https for Apache2.2 and consume PHP web services over https


Community Events

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


php7 laravel5 voicesoftheelephpant language unittest release opinion api framework extension podcast introduction series example version interview laravel library conference community

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