[Catalyst] Serving server-dependent static content

Pedro Melo melo at simplicidade.org
Mon Aug 13 22:14:44 GMT 2007


Hi,

On Aug 12, 2007, at 8:59 PM, mreece at vinq.com wrote:

>> On 8/12/07, Peter Lytle <pete at bluecampaigns.com> wrote:
>>> If someone has a  solution from the Apache side, that's fine but I
>>> suspect that it might be
>>> easier  to do this with Catalyst::Plugin::Static::Simple
>>
>> Don't serve static content through perl.  Let your webserver do it.
>> Usually people just set up virtual hosts with different
>> DOCUMENT_ROOTs.  Is there a reason that won't work for you?
>>
>> - Perrin
>
> a lot of times, 'static' content is found via database queries.  and
> sometimes that content needs to be protected from unauthorized  
> viewers,
> and your authorization mechanisms are already built into your  
> application,
> so you can't just use Alias/Rewrite directives to still have apache  
> serve
> up that tree.

In those cases, pick a server that understands Reproxy:

  1. hit goes through webserver into cat;
  2. cat does all the authorization stuff
  3. cat sends back header saying "Ok, webserver, send this static  
file": Reproxying
  4. webserver spoon feeds slow clients.

Both lighttpd and perlbal support this. I don't know if latest apache  
also does.

Best regards,
-- 
Pedro Melo
Blog: http://www.simplicidade.org/notes/
XMPP ID: melo at simplicidade.org
Use XMPP!





More information about the Catalyst mailing list