Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#33628 closed enhancement (maybelater)

Improve caching on get_theme_mods function

Reported by: spacedmonkey Owned by:
Priority: normal Milestone:
Component: Themes Version: 3.1
Severity: normal Keywords:
Cc: Focuses: performance

Description

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.

Attachments (2)

wp_theme_mods_cache.patch (1.5 KB ) - added by spacedmonkey 11 years ago.
wp_theme_mods_cache1.patch (2.2 KB ) - added by spacedmonkey 11 years ago.

Download all attachments as: .zip

Change History (4)

#1 @spacedmonkey
11 years ago

  • Resolutionmaybelater
  • Status newclosed

#2 @DrewAPicture
11 years ago

  • Milestone Awaiting Review
Note: See TracTickets for help on using tickets.