books
Free Books / Computers / Practical mod_perl /

previous page: 16.4.4. POST Requests
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 16.6. References

16.5. Avoiding Dealing with Headers




Description

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

There is another approach to dynamic content that is possible with mod_perl. This approach is appropriate if the content changes relatively infrequently, if we expect lots of requests to retrieve the same content before it changes again, and if it is much cheaper to test whether the content needs refreshing than it is to refresh it.

In this situation, a PerlFixupHandler can be installed for the relevant location. This handler must test whether the content is up to date or not, returning DECLINEDso that the Apache core can serve the content from a file if it is up to date. If the content has expired, the handler should regenerate the content into the file, update the $r->finfostatus and still return DECLINED, which will force Apache to serve the now updated file. Updating $r->finfo can be achieved by calling:

$r->filename($file); # force update of the finfo structure

even if this seems redundant because the filename is the same as $file. This is important because otherwise Apache would use the out-of-date finfo when generating the response header.

 

Continue to:

  • prev: 16.4.4. POST Requests
  • Table of Contents
  • next: 16.6. References

Books by Stas Bekman:















TOP
previous page: 16.4.4. POST Requests
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 16.6. References

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