1

I need to cache classmaps of each of my modules in my Zend framework 2 application using APC in opcode cache . Is there a work around for this .

AFAIK in the application.config.php

   'module_map_cache_enabled' => true,

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

// The path in which to cache merged configuration.

  'cache_dir' => 'path/to/data/cache',

By doing so Zend cache is using file system to cache I need it to use APC opcode cache how can I achive that .

I know to use APC in zend framework 1 at bootstrap.php .

But for this I am not finding any documentation in the official site .

Thanks in advance for responding to this post

akond
  • 15,865
  • 4
  • 35
  • 55
Aravind.HU
  • 9,194
  • 5
  • 38
  • 50

1 Answers1

0

The generated file will be cached by the APC opcode cache if you have the opcode cache enabled. You can check this by looking at the apc statistics page. Place this file temporarely on your server and watch the system cache entries tab. The module map and config cache does only support files and no cache adapters implementing the StorageInterface.

Bram Gerritsen
  • 7,178
  • 4
  • 35
  • 45
  • I think you are still confusing APC opcode cache and APC user/data cache. With the opcode cache opcodes are saved into APC (skipping the parsing and compilation process). If configured right (`apc.enabled = 1`, `apc.cache_by_default = 1`) the classmap file should be automaticly saved in the opcode cache. You also want to look into the `apc.stat` directive, it is recommended to set this to 0 on production to further reduce calls to the filesystem. – Bram Gerritsen Feb 19 '13 at 08:10
  • My question is about how to setup class maps of zend framework 2 to cache into opcode cache . not how to configure APC – Aravind.HU Feb 19 '13 at 08:48
  • You have told if configured right what actually you meant by that, where I have to set those parameters actually . – Aravind.HU Feb 19 '13 at 08:49
  • You can set the directives in your php.ini or /etc/php.d/apc.ini depending on your PHP installation. You only have to make sure apc opcode cache is turned on here, php will take care of caching your classmap. – Bram Gerritsen Feb 19 '13 at 12:15
  • Hey Thank you very much for clear explaination , it worked out for me I am able to see classmaps in the apc.php system cache entries thanks – Aravind.HU Feb 19 '13 at 17:19