ZF2 module for caching routing

Installs: 3

Dependents: 0

Stars: 3

Watchers: 2

Forks: 1

Open Issues: 4

Language: PHP

0.0.1-p1 2014-01-22 09:13 UTC



This is module for caching route configurations. Routing in ZF2 is flexible, but it's slow. Among many router types, Literal is very simple for routing. This module cache other routers into Literal route and store it. This version, module only support Mongo adapter for storage cache route.


  • Cache route base on URI
  • Support Mongo adapter for caching


Install via Composer

php composer.phar require tmquang/zf2-cache-route:*

Enable Module

Module must be enable in application.config.php (project-path/config) in modules section

return array(
    // This should be an array of module namespaces used in the application.
    'modules' => array(
        'CacheRoute', // => Add module Cache Route Here

    // Other configurations


  • Copy config files ( cacheroute.local.php.dist) from module/CacheRoute/config/ to project/config/autoload/
  • Rename cacheroute.local.php.dist into cacheroute.local.php
  • Re-config data from config files

To Do

  • Cache route base on scheme and hostname (for serving subdomain purpose)
  • Support multi adapters (redis, memcached, apc...)