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

Brandon Black blblack at gmail.com
Wed Jan 4 17:25:18 CET 2006


On 1/4/06, Richard Jolly <Richard.Jolly at bbc.co.uk> wrote:
> > Replying to myself...
> >
> > I realized that the pid will give better protection than the port
> > anyway. So I've got:
> >
> > __PACKAGE__->config->{cache}->{storage}
> >   = catfile( File::Spec::Functions::tmpdir, 'FileCache',  $$ );
> >
> > which works well.
>
> Replying to myself again (hopefully this will help somebody in the
> future):
>
> There is no need to change the storage location, as Cache::Cache has a
> namespace configuration option to handle this:
>
> __PACKAGE__->config->{cache}->{namespace} = $$;
>

I would suspect the best all-around cache namespace key would be the
complete base url of the application, as in
"http://myserver.mycompany.com:1234/Stuff/CatAppRoot".  All of that
should be determinable from within Catalyst regardless of the Engine
in use.

-- Brandon



More information about the Catalyst mailing list