Unable to use routing cache

Discussion specific to symfony 1.1.x stable

Unable to use routing cache

Postby gentrobot » Tue Apr 26, 2011 7:17 am

Hi !

I am using Symfony 1.1 and have defineed the routing settings in the factories.yml as:
Code: Select all
 
  routing:
    class: sfPatternRouting
    param:
      load_configuration: on
    variable_prefixes:  [':','$']
    segment_separators: ['/']
    variable_regex:     '[\w\d_]+'
    debug:              off
    logging:            on
    cache:
      class: sfFileCache
      param:
        automatic_cleaning_factor: 0
        cache_dir:                 %SF_CONFIG_CACHE_DIR%
        lifetime:                  31556926
        prefix:                    %SF_APP_DIR%

When the project is loaded, the cached files are created inside the ~/cache/frontend/env/config/ folder and I have a routing cached file as config_routing.yml.php which says
Code: Select all
<?php
// auto-generated by sfRoutingConfigHandler
// date: 2011/04/25 14:37:14"
....routing rules


However, I guess somehow this cached routing is not used by the application. Every time a new request is made, the log shows that it connects to each routing rule. Ideally, it should have connected to the routing rules once and for every other request, use the cached routing and only matched the request with the routing rule. I tried to look into the sfController, sfWebController, sfPatternRouting classes to get an idea of where exactly is the cached routing called, but couldn't figure it out.

Can you tell me what am I doing wrong here? If not the solution, at least could you please point me in the right direction.

Thanks
gentrobot
Member
 
Posts: 45
Joined: Thu Oct 08, 2009 7:43 am

Re: Unable to use routing cache

Postby gentrobot » Tue Apr 26, 2011 8:18 am

One more thing that I have noticed just now, that every time a new request is made, the date of generation for the config_routing.yml.php file does not change unless we do a symfony cache clearing. Does that mean that this cached file is being used? If it is, then why in the log do I see that it connects to every routing rule each time a new request is made?
gentrobot
Member
 
Posts: 45
Joined: Thu Oct 08, 2009 7:43 am


Return to symfony 1.1

Who is online

Users browsing this forum: Bing [Bot] and 0 guests