Cached view template path resolver to speed up the ZF2 view layer by avoiding stat calls
OcraCachedViewResolver is performance-oriented Zend Framework 2 Module that increases performance in your application by caching the process of resolving template names to template paths.
In ZF3, the process of resolving template paths causes a lot of stat calls. This module adds a cache layer to avoid that.
The recommended way to install
ocramius/ocra-cached-view-resolver is through
php composer.phar require ocramius/ocra-cached-view-resolver:3.0.*
If you use legacy/outdated PHP versions, such as
5.6.x, you can use any
You can then enable the module in your
config/application.config.php by adding
'OcraCachedViewResolver' to the
Default configurations are provided in
You can copy it to your application's
config/autoload directory and remove the
from the file name.
Note that without this file (or similar configuration),
OcraCachedViewResolver will use a so-called
"blackhole" cache that doesn't actually cache anything. The provided
.dist config file assumes that
you have the
APC extension installed: if that is not the case, please tweak this file.