Opened 15 years ago
Closed 15 years ago
#11146 closed enhancement (wontfix)
Allow to specify when SQL queries should not be cached
Reported by: | sirzooro | Owned by: | ryan |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9 |
Component: | Database | Keywords: | has-patch |
Focuses: | Cc: |
Description
Most of SELECT queries executed by WP core or plugins can be safely cached by plugins like 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.
Attachments (2)
Change History (4)
Note: See
TracTickets for help on using
tickets.
suggesting close as wontfix. why not simply check for rand() in the query string?