[wp-hackers] Questions about the Cache
ryan at boren.nu
Tue Jul 25 20:59:21 GMT 2006
Brian Layman wrote:
>> I got my article posted on Friday:
> I'm glad you informed the list.
> Good article. Thank you.
> I am assuming that wp_cache_get() will return FALSE, if ENABLE_CACHE is not
> defined. So, it is safe to write the code directly using wp_cache_get
> rather than checking the ENABLE_CACHE value every time. Is that correct?
ENABLE_CACHE means that "persistent" caching is enabled. Even if the
persistent cache is disabled, the in-memory cache that is tossed with
each page load is still operational. wp_cache_get() will retrieve
values from that in-memory cache. A typical page load does
get_option('siteurl') many times. If we didn't cache the siteurl value
to memory, we would have to make dozens of round trips to the DB.
ENABLE_CACHE and DISABLE_CACHE aren't part of the API and shouldn't be
used in plugins. They are simply wp-config settings that control the
More information about the wp-hackers