ZF2 Cache:How to Enable The merged configuration cache ?

Zend Framework 2’s Module Manager has the ability to cache the merged configuration information for your application.merged configuration Means that all module configs and class maps over modules are merged in ZF2, in general on each request , this merging process will reduce the application performance. In order to improve ZF2 app performance we need to set The merged configuration cache.

During development this can be a painful , so be sure to delete cache file to see new changes.

Go to config/application.config.php , then add the fallowing to module_listener_options array

        // Whether or not to enable a configuration cache.
        // If enabled, the merged configuration will be cached and used in
        // subsequent requests.
        'config_cache_enabled' => TRUE,

        // The key used to create the configuration cache file name.
        'config_cache_key' => "arjun123456789",

        // Whether or not to enable a module class map cache.
        // If enabled, creates a module class map cache which will be used
        // by in future requests, to reduce the autoloading process.
        'module_map_cache_enabled' => TRUE,

        // The key used to create the class map cache file name.
        //'module_map_cache_key' => "arjun123456",

        // The path in which to cache merged configuration.
        'cache_dir' => "./data/cache",

Make the cache directory writable, if every thing is fine you can able to see the cache file in the cache location

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

DMCA.com Protection Status