Dancer::Session::CHI on github
https://github.com/richardhuxton/perl-dancer-session-chi Don't be frightened by the low version number - there's only a dozen lines of code or so. I'll try and find the time to sort out a CPAN upload too. -- Richard Huxton Archonet Ltd
On Wednesday 26 October 2011 22:54:02 Richard Huxton wrote:
https://github.com/richardhuxton/perl-dancer-session-chi
Don't be frightened by the low version number - there's only a dozen lines of code or so.
I'll try and find the time to sort out a CPAN upload too.
Nice one - another valuable addition to the growing Dancer ecosystem. I do wonder, though, whether it should work with Dancer::Plugin::Cache::CHI though, to avoid the need to keep creating CHI objects, and the need to provide two sets of CHI configuration. I would imagine that, if an app is using CHI to hold sessions, they are fairly likely to also use it for caching stuff, so having to configure both D::P::Plugin::Cache::CHI and D::S::CHI with the same set of details would be a little tiresome. What do you think? -- David Precious ("bigpresh") http://www.preshweb.co.uk/ "Programming is like sex. One mistake and you have to support it for the rest of your life". (Michael Sinz)
Good day, And i think that D::S::CHI should be multi-hosts (when under one Dancer process to be run many applications for some hosts through Plack::Builder for example - using a Host HTTP Header) I didn't see a sources of the D::S::CHI but the D::P::Plugin::Cache::CHI had this problem. Now author of last added the 'cache_page_key_generator' directive for tuning this (i can add there my own function for generation of keys based on "Host:" http header for example). Thanks for new module! ;-) Perlover 2011/10/27 David Precious <davidp@preshweb.co.uk>:
On Wednesday 26 October 2011 22:54:02 Richard Huxton wrote:
https://github.com/richardhuxton/perl-dancer-session-chi
Don't be frightened by the low version number - there's only a dozen lines of code or so.
I'll try and find the time to sort out a CPAN upload too.
Nice one - another valuable addition to the growing Dancer ecosystem.
I do wonder, though, whether it should work with Dancer::Plugin::Cache::CHI though, to avoid the need to keep creating CHI objects, and the need to provide two sets of CHI configuration.
I would imagine that, if an app is using CHI to hold sessions, they are fairly likely to also use it for caching stuff, so having to configure both D::P::Plugin::Cache::CHI and D::S::CHI with the same set of details would be a little tiresome.
What do you think?
-- David Precious ("bigpresh") http://www.preshweb.co.uk/
"Programming is like sex. One mistake and you have to support it for the rest of your life". (Michael Sinz) _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
On 27/10/11 10:26, Perlover wrote:
Good day,
And i think that D::S::CHI should be multi-hosts (when under one Dancer process to be run many applications for some hosts through Plack::Builder for example - using a Host HTTP Header) I didn't see a sources of the D::S::CHI but the D::P::Plugin::Cache::CHI had this problem. Now author of last added the 'cache_page_key_generator' directive for tuning this (i can add there my own function for generation of keys based on "Host:" http header for example).
Haven't got a hook, but there's a (currently undocumented) "namespace" parameter that you can supply from the config. That will let you have multiple apps in the same cache, but not handle the situation you're describing. I'll have a look at the Plugin::Cache code and see what applies here.
Thanks for new module! ;-)
I await my fame and fortune as word of this wondrous addition spreads :-) -- Richard Huxton Archonet Ltd
On 27/10/11 10:08, David Precious wrote:
On Wednesday 26 October 2011 22:54:02 Richard Huxton wrote:
https://github.com/richardhuxton/perl-dancer-session-chi
Don't be frightened by the low version number - there's only a dozen lines of code or so.
I'll try and find the time to sort out a CPAN upload too.
Nice one - another valuable addition to the growing Dancer ecosystem.
I do wonder, though, whether it should work with Dancer::Plugin::Cache::CHI though, to avoid the need to keep creating CHI objects, and the need to provide two sets of CHI configuration.
Hmm - having a look now. There should be some fairly clean way to do that. -- Richard Huxton Archonet Ltd
On 27/10/11 18:54, Richard Huxton wrote:
On 27/10/11 10:08, David Precious wrote:
I do wonder, though, whether it should work with Dancer::Plugin::Cache::CHI though, to avoid the need to keep creating CHI objects, and the need to provide two sets of CHI configuration.
Was this the sort of thing you were thinking of: https://github.com/richardhuxton/perl-dancer-session-chi/tree/session_via session: CHI session_via: "Dancer::Plugin::Cache::CHI::cache" The "via" can be any sub returning a CHI object, but seems to work with DPCC out of the box. -- Richard Huxton Archonet Ltd
participants (3)
-
David Precious -
Perlover -
Richard Huxton