[wp-trac] [WordPress Trac] #33628: Improve caching on get_theme_mods function

WordPress Trac noreply at wordpress.org
Mon Aug 31 18:03:56 UTC 2015


#33628: Improve caching on get_theme_mods function
--------------------------+-----------------------------
 Reporter:  spacedmonkey  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  3.1
 Severity:  normal        |   Keywords:
  Focuses:  performance   |
--------------------------+-----------------------------
 Currently whenever the get_theme_mods function is called, it calls the
 also the get_options function twice. This means that whenever the
 get_theme_mod / set_theme_mod / remove_theme_mod , also makes a call to
 options table. This value is not cached in memory, so whenever
 get_theme_mod is called it will get the values from the db / object cache.

 To improve performance, after the first time the function is called, theme
 mods should be stored as a global / static variable.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33628>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list