Closed (fixed)
Project:
DART
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2012 at 20:44 UTC
Updated:
17 Mar 2012 at 23:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
bleen commented(quick note: whenever you submit a patch, you should always mark the issue as "needs review")
I'm not sure about adding this option directly to the DART module. The configuration forms are already pretty complicated. This isn't a definite no but I want to think about it for a bit. In the mean time I recommend you take a look here: http://drupal.org/project/blockcache_alter. It's well maintained and should solve your problem.
Comment #2
mshick commentedYeah, understandable. I tried to make it as "clean" as possible by making the cache setting a hidden dependent.
I think blockcache_alter could be helpful, and I'll definitely investigate but I see it currently doesn't work with Drupal core. That would be my general fear of using a module to support the cache setting post-hoc; it's not an approach to caching that seems particularly well supported in D6.
Setting these things in the generating modules directly doesn't totally make sense to me, but it does seem like the safest approach.
Anyway, thanks for the reply. Let me know how you decide to proceed.
Comment #3
rickvug commentedI was testing some code today and found that DART was adding about 12 queries per page. This was true even if block caching is enabled, which led me to this issue. The change to make block caching makes a lot of sense as otherwise DART will not function correctly when block caching is enabled. I'm also wondering if further caching is needed for the key/value pairs for a given page? Is it dart_taxonomy and context that is causing the extra queries even if block caching is enabled? Specifically devel reports 6 queries from dart_taxonomy_map_get() and 6 queries from taxonomy_get_parents().
Perhaps the first step is getting block caching fixed with the patch provided here, followed a look into caching any remaining queries that occur when block caching is enabled.
Comment #4
bleen commentedrickvug ... lets just focus on the block caching in here for now. In the mean time, have you tried the patch in the original post? Can you give a quick kick of the tires and if it helps with the performance, then I will definitly take another look.
Comment #5
rickvug commented@bleen18 I haven't tried the original post as it is for D6 and I'm running D7.
That said the problem is that the default cache setting for blocks is DRUPAL_CACHE_PER_ROLE. As mshick stated in the first post, DART block's variables aren't changing from page to page with block caching enabled. Setting the block cache to DRUPAL_CACHE_PER_PAGE would solve the problem. I don't know if the role based cache is needed as well (DRUPAL_CACHE_PER_ROLE | DRUPAL_CACHE_PER_PAGE). Under what circumstances would the ad tag differ between roles? Either way a solution could be a single line if the configuration in the exportable is removed. If you can see cases where a site would want to fine tune caching per block then the approach in this patch is the way to go. Any way that you solve the problem performance won't be improved (there will actually be less block caching).
Comment #6
bleen commentedfor the time being I have committed this patch to 7.x-2.x and a similar one to 6.x-2.x
I think this is the correct block caching for 99% of use-cases.
Comment #7
rickvug commentedLooks good to me. Thanks for being so quick to fix the issue.