As per discussion in http://drupal.org/node/111975,
attached is a patch that moves cached queries out of {view_view} and into {cache}
I tested it to work OK with cacheable views, uncacheable views (because of arguments), and cacheable or uncacheable views with run-time substitutions (filter "author is currently logged in user")
Additional tests are welcome, of course.
BTW, I created a _views_get_query function in views_cache.inc, maybe that is not the right place ? (besides, views_cache.inc does not exist in 4.7 branch, I believe)
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | cached_queries3.patch | 8.03 KB | yched |
| #1 | cached_queries2.patch | 8.01 KB | yched |
| cached_queries.patch | 7.42 KB | yched |
Comments
Comment #1
yched commentedforgot to drop the cache when the view is saved or deleted
+ forgot 'review' status
Comment #2
yched commentedPrevious patch caused SQL errors because of missing $table argument in cache_clear_all calls
+ bump ?
Comment #3
moshe weitzman commentedseems a bit odd to move code from a specialized table in the general cache table. wouldn't we at least want a dedicated cache table like cache_menu, cache_page, etc. specializing these tables is nice because deletes become much cheaper.
Comment #4
yched commentedYes, there is another thread about that : http://drupal.org/node/115849, and we discussed there if both patches should be merged. It was decided to do that separately.
Whichever one goes in first, the other patch should be pretty easy to update.
Comment #5
merlinofchaos commentedApplied with some changes.
First, the cid uses the view name rather than the vid for finding a query in the cache. This means that default queries can have their query cached, which is an improvement.
I also successfully backported this to 4.7.
Comment #6
(not verified) commented