0

So I'm working on a big website that runs fine on live (A bit on the slow side, but not unbearable), but when it comes to development servers it runs like ass (30 seconds to load a page ass). I used xdebug to profile the code, and what I found was that about half of the time in execution is spent updating the database. More specifically, on every page load when the Context module would load the the block list, it would look for block info in the cache, find nothing and then go and call _block_rehash, which then does DB updates for what appears to be every block. I tracked it down to where the context module tries to get a cache with

$cache = get_cache('context', 'cache');

And it comes back empty. I have caching enabled, block caching enabled, and I'm not sure why this is happening. Can anybody shed some light on this issue? This is an installation of Drupal 7 and Context 7-3.1

  • My blind guess is that you are using memcached or apc for cache on production, and simply don't have it in dev, so the cache is always empty. – Mołot Nov 19 '13 at 8:44
  • I went ahead and installed memcache, but it didn't fix the issue – Gareth Parker Nov 19 '13 at 23:12
0

It turns out that my settings.php file had some custom code to completely disable caching for localhost machines, so that developers wouldn't be forced to refresh the cache all the time. Commenting out that code produced the performance that I expected

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.