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

Eran Galperin's Blog: Multiple row operations in MySQL / PHP

Lorna Mitchell: Do Open Source with Git and Github

The Bakery: Basic User Authentication in (CakePHP) 1.2.x

Francesco Tassi: Switching From TDD to BDD With Behat and Symfony2

Mike Dalisay: Salt, Hash and Store Passwords Securely with Phpass


Community Events

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


laravel psr7 opinion wordpress community voicesoftheelephpant laravel5 podcast framework language library api development conference release series unittest interview introduction extension

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