[Catalyst-commits] r12375 -
trunk/examples/CatalystAdvent/root/2009/pen
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Tue Dec 15 00:55:05 GMT 2009
Author: t0m
Date: 2009-12-15 00:55:05 +0000 (Tue, 15 Dec 2009)
New Revision: 12375
Modified:
trunk/examples/CatalystAdvent/root/2009/pen/media_delivery.pod
Log:
Write a bit more
Modified: trunk/examples/CatalystAdvent/root/2009/pen/media_delivery.pod
===================================================================
--- trunk/examples/CatalystAdvent/root/2009/pen/media_delivery.pod 2009-12-14 23:50:44 UTC (rev 12374)
+++ trunk/examples/CatalystAdvent/root/2009/pen/media_delivery.pod 2009-12-15 00:55:05 UTC (rev 12375)
@@ -3,16 +3,31 @@
=head2 Why?
-One use uris
+Why would you want to deliver static media with Catalyst at all?
-Time limited uris
+Generally you use the L<Static::Simple|Catalyst::Plugin::Static::Simple>
+plugin to serve assets (.css and image files) from the C</root/static> directory.
+However for production use you are recommended to configure your webserver
+to directly serve the static content as this is B<much> more efficient.
-Too much media to fix on one physical machine
+Using an entire application server process (i.e. a perl process) to serve static media
+is a massive waste of resources, especially if you're not using a front-end proxy
+(as your web server ends up with a heavyweight perl process tied up sending bytes to
+a user rather than doing useful work).
-=head2 How
+However, there are a number of cases where just unconditionally serving the static content
+to the user is a bad idea - think protected .pdf documents, think time limited URIs, think
+single use (or n-use) download URIs.
-->serve_static_file is a great start, but.
+Also, how about you have too much media to fit on one physical machine and you're using
+something like MogileFS. XXX FIXME LINK
+=head2 How?
+
+Well, if your app is small, and as a first implementation, then using the
+L<serve_static_file|Catalyst::Plugin::Static::Simple/serve_static_file> method is a good way to
+start when prototyping your system.
+
X-Accel-Redirect
X-Sendfile
@@ -23,6 +38,8 @@
Example web server config for reproxying
-Example code snippet.
+Example code snippet for one use uris.
+Example code snippet for timed uris.
+
More information about the Catalyst-commits
mailing list