[wp-trac] [WordPress Trac] #52710: Taxonomy: Make it possible to bypass automatic caching of results in `get_terms()`

WordPress Trac noreply at wordpress.org
Sun Jan 23 23:06:41 UTC 2022


#52710: Taxonomy: Make it possible to bypass automatic caching of results in
`get_terms()`
----------------------------------------+------------------------------
 Reporter:  dlh                         |       Owner:  (none)
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Taxonomy                    |     Version:  2.3
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |     Focuses:  performance
----------------------------------------+------------------------------

Comment (by spacedmonkey):

 Can't you just pass a random string to the `cache_domain` field. It would
 mean that cache's would always miss.

 You can do this in a small plugin as well.

 {{{#!php
 add_filter('get_terms_defaults', function( $query_var_defaults ){
    $query_var_defaults['cache_domain'] = microtime();
    return $query_var_defaults;
 });
 }}}

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


More information about the wp-trac mailing list