[Dancer-users] Conditional HTTP proposal

Oleg A. Mamontov oleg at mamontov.net
Fri Feb 11 22:57:54 CET 2011


On Feb 12, 2011, at 12:27 AM, Flavio Poletti wrote:

> On Fri, Feb 11, 2011 at 3:04 PM, Oleg A. Mamontov <oleg at mamontov.net> wrote:
> > Any specific reason not to use the appropriate middleware?
> 
> Nobody use `./bin/app.pl` for development (with no Plack) ?
> 
> Out of curiosity and completely neutral with respect to the topic, is:
> 
>    ./bin/app.pl
> 
> so much different from:
> 
>    plackup bin/app.pl
> 
> in your experience? I was inclined not use use plackup in the first place, but after some time I understood that I had no good reason. On the other hand, it seems that sometimes there are good reasons to use it, like in this case.
> 
> From what I understand in stuff I read around, you're more or less forced to go with Plack when you're in production, so why striving to avoid it?

You are completely right and i agree with you.
My point of view is very simple.
We can delegate serve static files to Plack or anything other.
No problem, but it would be good to document this recommendation in manual
and remove this code from Dancer core.
But if Dancer offers its own built-in functionality, it seems to me
that we need to do it with maximum quality. Isn't it?
Poorly made functionality worse than missing functionality because it creates ambiguity.

BTW, see source code for Catalyst::Plugin::Static::Simple in _serve_static method.
There is no conditional get but there is:
    $c->res->headers->last_modified( $stat->mtime );
What do you think, why is it done?
Without this header many browsers will re-request all your static files when
you navigate on your site with mouse clicks (no force page refresh).
Just one simple header (Last-Modified) and you skip a lot of requests!

I did not expect that such simple and obvious things can generate as much debates :(

> 
> Cheers,
> 
>     Flavio.


-- 
Cheers,
Oleg A. Mamontov

mailto:  oleg at mamontov.net

jabber:  lonerr at charla.mamontov.net
icq uin: 79-521-617
cell:    +7-903-798-1352



More information about the Dancer-users mailing list