[wp-trac] [WordPress Trac] #14911: Don't fetch theme_roots on every page load.

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 20 20:09:37 UTC 2010

#14911: Don't fetch theme_roots on every page load.
 Reporter:  ryan          |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.1
Component:  Performance   |     Version:     
 Severity:  normal        |    Keywords:     
 As part of setting up the directories for the current theme,
 get_theme_roots() and thus get_site_transient( 'theme_roots' ) is called
 on every page load.  If you have many themes (typical for multisite
 setups) this means a lot of data is being pulled from the cache.  If using
 a remote cache like memcached all of this data is going over the wire.  An
 active multisite install with many themes and memcached can waste 100s of
 MBs of bandwidth pulling the same data over and over.

 To avoid fetching theme_roots on every page load, lets store the roots for
 the current stylesheet and template in the options table as template_root
 and stylesheet_root.  If these are present we can avoid calling
 get_theme_roots() for almost all page loads.

Ticket URL: <http://core.trac.wordpress.org/ticket/14911>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list