[Catalyst] FileCache and PageCache for same app on different ports

Richard Jolly Richard.Jolly at bbc.co.uk
Wed Jan 4 15:16:20 CET 2006


Hi,

We have multiple developers running the same application on different
ports. 

Since they share the same cache (FileCache defaults to /tmp/FileCache),
and the port isn't part of the cache key
(&PageCache::_get_page_cache_key), we are getting cached pages served
incorrectly.

Ideally I'd like to specify the port as part of the cache storage
location:

  package MyApp;

  use Catalyst qw/Cache::FileCache PageCache/;

  # make sure caches for apps running on different ports do not conflict
  __PACKAGE__->config->{cache}->{storage} = "tmp/FileCache/$PORT";

Is this the right way to do it? 

And how can I get the port variable here? Its passed down to
Catalyst::Engine::*, but I don't see any accessors.

Thanks,

Richard Jolly




More information about the Catalyst mailing list