[wp-trac] [WordPress Trac] #14348: If it's a HEAD request, stop after the head!

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 18 23:15:00 UTC 2012


#14348: If it's a HEAD request, stop after the head!
---------------------------------------------+------------------
 Reporter:  mitchoyoshitaka                  |       Owner:
     Type:  enhancement                      |      Status:  new
 Priority:  normal                           |   Milestone:  3.5
Component:  Performance                      |     Version:  3.0
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch 3.5-early 2nd-opinion  |
---------------------------------------------+------------------
Changes (by nacin):

 * milestone:  Future Release => 3.5


Comment:

 What if we did this:

 {{{
 add_action( 'template_redirect', 'wp_exit_on_http_head', 1000 );
 function wp_exit_on_http_head() {
     if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] )
         exit;
 }
 }}}

 Alternatively, [attachment:14348-4.diff] but without the constant. Only
 the filter is really needed.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14348#comment:29>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list