[wp-trac] [WordPress Trac] #29894: get_terms() isn't caching - duplicate queries generated
WordPress Trac
noreply at wordpress.org
Wed Oct 8 20:30:36 UTC 2014
#29894: get_terms() isn't caching - duplicate queries generated
-------------------------------+---------------------------
Reporter: webgeekconsulting | Owner: boonebgorges
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 4.1
Component: Taxonomy | Version: 4.0
Severity: normal | Resolution:
Keywords: has-patch | Focuses: performance
-------------------------------+---------------------------
Comment (by webgeekconsulting):
Replying to [comment:5 boonebgorges]:
> +1 for this change - using the SQL for a cache key seems much more sane
to me.
>
> Changing the key will cause existing persistent caches to become
defunct. In certain situations this could cause a cache stampede, but
that's a very remote possibility with a small item like this.
I've attached another patch that might rectify any chance of a cache
stampede. Basically, keep the existing cache check in place, but as an
extra layer of protection add in the second cache check using the hash of
the SQL statement as the key.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29894#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list