HTTP::Response::OnDisk is an API-compatible replacement for HTTP::Response, whose purpose is to store the content into disk instead of memory. This greatly reduces overhead on long-running processes, such as crawlers like Gungho.

Code, message, and headers are fairly harmless in comparison to the content, so they are stored in memory. Content is stored on a temporary file disk, which is cleaned up when the response is freed.

Attempts to decode the content based on Content-Transfer-Encoding, and the character set specified. Note that this method internally behaves quite differently from that of HTTP::Response.

For now this actually overwrites the internal buffer. If you care enough about memory to use this module, you shouldn't be doing stuff that requires reading the entire buffer out anyways. Let this method take care of the content, and access it later.