[wp-trac] [WordPress Trac] #11146: Allow to specify when SQL queries should not be cached

WordPress Trac wp-trac at lists.automattic.com
Sun Nov 15 21:25:17 UTC 2009


#11146: Allow to specify when SQL queries should not be cached
-------------------------+--------------------------------------------------
 Reporter:  sirzooro     |       Owner:  ryan     
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  2.9      
Component:  Database     |     Version:  2.9      
 Severity:  normal       |    Keywords:  has-patch
-------------------------+--------------------------------------------------
 Most of SELECT queries executed by WP core or plugins can be safely cached
 by plugins like [http://wordpress.org/extend/plugins/db-cache-reloaded/ DB
 Cache Reloaded]. However there are some which are different every time
 (e.g. includes current date and time in WHERE clause), return different
 records every time (e.g. use RAND()), etc. Therefore I suggest to add
 common way to tell which queries should not be cached.

 Attached patch adds new parameter `$maybe_cache` to all functions of
 `wpdb` class, which can be used to execute SELECT query.

 2nd patch changes `get_calendar()` to use this new parameter - it executes
 two queries with current date/time in WHERE clause.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11146>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list