Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Mar 2008 at 16:18 UTC
Updated:
15 Mar 2010 at 18:12 UTC
We are using views in a very dynamic way. The attached patch adds some static caching in various places. Together, this tiny patch removed about 15 queries per page for us.
| Comment | File | Size | Author |
|---|---|---|---|
| patch49.patch | 994 bytes | m3avrck |
Comments
Comment #1
merlinofchaos commentedThis should use array_key_exists rather than a separate $cache_null variable.
Why would views_get_all_urls ever be called more than once on a page?
Comment #2
m3avrck commentedYou know I was working on it all morning and I'm not exactly sure. This patch might be specific to how we're using views.
We have a view setup: community/$arg/node-type
But we dynamically change that and add filters using the views hooks. Because of this, and the fact that we programatically provide default views, something wasn't being cached. Looking at the code, that single query there was executing more than once since we were reusing a view twice on a page (although it ran 3 times, go figure).
Like I said, this might be an issue that just applies to us. But I figured I'd put it out there for anyone that is interested.
Since Views 1.x is on the way out this was our quick fix :)
Comment #3
sunThis looks quite interesting, but I think we can assign something faster here:
Comment #4
esmerel commentedNo changes being made to 1.x. I'd leave it in 'needs review' if the patch was ready, but.
Comment #5
esmerel commentedNo changes being made to 1.x. I'd leave it in 'needs review' if the patch was ready, but.