[wp-testers] **OT** Variable definitions in functions.php

John Blackbourn johnbillion+wp at gmail.com
Mon Mar 22 11:48:44 UTC 2010


On Mon, Mar 22, 2010 at 11:21 AM, Paul Robinson <pablorobinson at gmail.com> wrote:
>
> Another quick question though, how come the overhead on get_option is so
> small, doesn't it access the db each time it's called?

The result of get_option('my_option') is stored in an object cache.
This is basically just a fancy wrapper around storing the result in a
global variable array. Any subsequent calls to get_option('my_option')
during the same page load fetch the value from the cache instead of
the database.

See http://codex.wordpress.org/Function_Reference/WP_Cache if you're
interested in the details.


More information about the wp-testers mailing list