Closed (fixed)
Project:
RobotsTxt
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Dec 2012 at 16:51 UTC
Updated:
2 Jun 2014 at 13:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
hass commentedBut the module does not cache the robots.txt as I know. The variable we are reading is cached, but there is no need to cache more as I know.
Comment #2
johan.gant commentedThis is more to do with the request/response process than where the data for robots.txt is stored.
With a call to exit() you will always get a response header with the following: X-Cache:MISS
If you're behind an HTTP cache such as Varnish or have Drupal's anonymous page cache enabled you don't want this to happen as it could, in principle, add unwanted request load to your backend webserver(s). In this instance, if you used drupal_page_footer() instead of exit() your first request will get X-Cache:MISS and subsequent requests will be X-Cache:HIT... until the cache expires for that item at least.
drupal_page_footer() ensures final end of request tasks are correctly handled. A call to exit() is far less helpful than drupal_page_footer(). That's my point and what my patch aims to address.
Comment #3
les limAlternatively, there's drupal_exit() as well:
http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_exit/7
Comment #4
hass commentedSo we go with drupal_exit().
Comment #5
les limNew patch.
Comment #6
hass commentedComment #7
hass commentedComment #10
hass commented