[wp-trac] [WordPress Trac] #37833: To optimize database queries on page load

WordPress Trac noreply at wordpress.org
Fri Aug 26 05:55:08 UTC 2016


#37833: To optimize database queries on page load
----------------------------+--------------------------
 Reporter:  KaugKo          |       Owner:
     Type:  enhancement     |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Bootstrap/Load  |     Version:
 Severity:  normal          |  Resolution:  invalid
 Keywords:                  |     Focuses:  performance
----------------------------+--------------------------
Changes (by pento):

 * status:  new => closed
 * version:  trunk =>
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Hi @KaugKo, thanks for the suggestion!

 There are already several optimisations around loading options - if a
 plugin creates an option with `add_option()`, and sets the `$autoload`
 parameter to `'yes'`, the option will be automatically loaded at the start
 of every page load, as you suggested.

 Another optimisation is when there are multiple calls to `get_option()` -
 if the same option is retrieved twice, the second retrieval won't cause a
 database query, as the option is already cached.

 By default, both of these caches are reset at the end of the page load,
 but there are also plugins that will allow this cache to persist between
 page loads, removing more load from the MySQL server. You can read more
 about them here:

 https://codex.wordpress.org/Class_Reference/WP_Object_Cache#Persistent_Cache_Plugins

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37833#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list