[wp-trac] [WordPress Trac] #17177: Optimize parse_request for the home page (empty request)

WordPress Trac wp-trac at lists.automattic.com
Sat May 14 21:15:34 UTC 2011


#17177: Optimize parse_request for the home page (empty request)
--------------------------+------------------
 Reporter:  duck_         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.2
Component:  Performance   |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------

Comment (by duck_):

 A lot more code movement this time so please read and test carefully.

 Moved the empty and wp-app.php checks out of the loop, no need to
 continually run them if they don't pass the first time. Not really sure
 why but I don't really like the `$matches = array('');` we could add a
 preg_match there just because, thoughts?

 Tested with and without:

 {{{
 add_action( 'init', function() { add_rewrite_rule( '$', 'index.php?p=1' );
 });
 }}}

 Passes all the rewrite/query tests as well as my random testing. Might
 want to double check some of the lesser used rewrite structures, e.g. with
 slug prefix, pathinfo, etc.

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


More information about the wp-trac mailing list