books
Free Books / Computers / Practical mod_perl /

previous page: 16.4.2. Conditional GET Requests
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 16.4.4. POST Requests

16.4.3. HEAD Requests




Description

This section is from the "Practical mod_perl" book, by Stas Bekman and Eric Cholet. Also available from Amazon: Practical mod_perl

Among the headers described thus far, the date-related ones (Date, Last-Modified, and Expires/Cache-Control) are usually easy to produce and thus should be computed for HEAD requests just the same as for GET requests.

The Content-Type and Content-Length headers should be exactly the same as would be supplied to the corresponding GET request. But since it may be expensive to compute them, they can easily be omitted, since there is nothing in the specification that requires them to be sent.

What is important is that the response to a HEAD request must not contain a message-body. The code in a mod_perl handler might look like this:

# compute the headers that are easy to compute
# currently equivalent to $r->method eq "HEAD"
if ( $r->header_only ) { 
    $r->send_http_header;
    return OK;
}

If a Squid accelerator is being used, it will be able to handle the whole HEAD request by itself, but under some circumstances it may not be allowed to do so.

 

Continue to:

  • prev: 16.4.2. Conditional GET Requests
  • Table of Contents
  • next: 16.4.4. POST Requests

Books by Stas Bekman:















TOP
previous page: 16.4.2. Conditional GET Requests
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 16.4.4. POST Requests

Topics

  • Animals
  • Architecture
  • Arts
  • Business
  • Computers
  • Crafts
  • Fairy Tales
  • Finance
  • Flora and Plants
  • Cooking
  • Gardening
  • Health and Healing
  • History
  • Home Improvements
  • Languages
  • New Age
  • Novels
  • Real Estate
  • Reference
  • Religion
  • Science
  • Society
  • Sports
  • Travel
  • Outdoors


Search

My Books

Headaches Begone! A Systemic Approach To Healing Your Headaches
Don't Let Your Bike Seat Ruin Your Sex Life Book

Discover

  • Answers FAQ

[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007-2021 StasoSphere.com