[wp-trac] [WordPress Trac] #16287: get_option() - store retrieved option in a global array?

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 18 15:02:59 UTC 2011


#16287: get_option() - store retrieved option in a global array?
---------------------------+----------------------------------
 Reporter:  digitalnature  |      Owner:
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Database       |    Version:  3.1
 Severity:  normal         |   Keywords:  get_option, database
---------------------------+----------------------------------
 Hi

 Themes, plugins and core call this function a lot, and there are many
 times when the same option gets requested more than once.

 I guess this is not a problem when the user has some kind of cache plugin
 turned on, but most people don't, so the same database query gets to run
 twice or more in the same request. This saves around 30% of db calls on a
 typical wp site.

 Is it possible to store the value of a retrieved option in a global array?
 and when the same option is requested again it would get pulled out from
 that array instead of the db.


 Or at least add a action hook in that function so we can override it :)
 because option_optionname filter doesn't help...

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


More information about the wp-trac mailing list