in reply to Re: HTTP::Proxy filter for dishing out own files
in thread HTTP::Proxy filter for dishing out own files

Thank you very much for the response! :-)

I have a follow on question before I try what you sent. For the response code:
if (-s $cache_path) { # is it in the cache? # this would of course be the content read from the cache +file... my $content = "<html><body>...yadda yadda...</body></html> +"; # create response my $res = HTTP::Response->new(200); $res->content_type('text/html'); $res->content($content); # send back (short-circuit normal content fetching) $self->proxy()->response($res); }

I would like to know how I can assign the contents of an entire file to the HTTP::Reponse. The response will have the necessary header fields in it if I can just throw the entire file back to the client.
I might need to through my own response code, but that will be easy enough.
I would prefer not to have to read in all of the original headers and assign to each component of HTTP::Response, if I can avoid it.

Thanks in advance for your help.