A. Pagaltzis wrote:
Hi Brian,

* Brian Kirkbride <[EMAIL PROTECTED]> [2007-04-12 19:25]:
I have a CMS-like application using Catalyst for which about
40-50% of requests contain large file uploads. I'm using a
pretty standard two-tiered setup to avoid tying up heavy
mod_perl procs for slow client downloads.

[…]

I'm thinking of splitting file upload handling out to a
simple CGI app (no Catalyst code) that serializes the request,
including uploaded files, to a tmp directory. It would then
redirect to a Catalyst-handled URL matching the serialized
request.

My suggestion is to do something much more transparent.

Use a CGI script on the front-end webserver to accept uploads.
When the upload completes, the CGI script then in turn makes a
HTTP request to the application webserver server to upload the
file, and returns the app’s response to the client.

That way, the actual application itself does not need to change
at all. There is no serialisation mechanism, no extra code in the
application to handle such a special upload mechanism, no need
for configuration of filesystem paths or other shared resources,
nothing. The handling is isolated on the front-end webserver.

This way, a programming consideration becomes a mere deployment
consideration.

HTTP is great like that.

Is there something like this in existence already? I searched
Google and CPAN but didn't find anything promising. I'd
appreciate any tips or suggestions. If I do implement it from
scratch, would there be any interest in the CGI and a Catalyst
base controller being released on CPAN?

Sometimes, there is no code to do something because no code is
needed to do it. :-)


Wonderful, thank you for the insight Aristotle. I will try Perrin's suggestion of using an upload-buffering proxy first, falling back on a simple CGI proxy like this if need be.

_______________________________________________
List: [EMAIL PROTECTED]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to