On 28 Jul 2009, at 14:55, Ash Berlin wrote:
On 28 Jul 2009, at 14:42, John SJ Anderson wrote:
$WORK-mate is working on a Cat app that (among other things) allows
authenticated users to download from a set of static files. He's
wondering what the best way is to set things up so that the Cat app
can handle the authentication/authorization parts of things but then
hand the static file serving part off to Apache.
Thanks for any help/hints.
john.
Largely depends on what webserver you are using. Lighttpd has X-
LIGHTTPD-Sendfile (or something similarly named) nginx has
something like X-Accel-Redirect which does the same (and can do
more.) Both of these tell the webserver to serve static content
from a file. Hit google for these env vars to find out how they work
There's an apache module which will do the same as the lighttpd one
http://tn123.ath.cx/mod_xsendfile/ Never used it mind.
Whilst this is all sage advice, remember - DO THE SIMPLEST THING
WHICH COULD POSSIBLY WORK.
Ergo, $c->serve_static_file($c->path_to(qw/ sekrit_files
file1.avi /)); is probably a good bet (From
Catalyst::Plugin::Static::Simple).
Unless you have dozens of concurrent users, all downloading large
files (where large is 10s of Mbs), then just do that - it's easy, it
works, you don't have to think about production vs development, etc.
Cheers
t0m
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/