1

I am using Drupal 7 for a real time web application so I cannot afford any caching at all. I also could not find any such option in performance section of Admin Panel. Kindly suggest a method with involving the command line.


UPDATED:

Let me explain the problem further.

Yes theme isn't problem for me. I am new to drupal ad still exploring.

What problem I face is I have written a module which takes CSV file from user, parses and calls moodle web-services to perform operations. What happens sometimes is it seems like that data or code in module is not managed properly and it generates useless/meaningless errors. When I do 'Clear All Caches' at Home » Administration » Configuration » Development; everything gets fixed.

  • To address you edit: In light of that, I would even more strongly recommend that you don't just wildly disable cache. Find out exactly what the problem is, and fix it. Work out which cache keys from which bins are causing you the problems, and come up with a way to deal with that. Disabling every cache in a heavy application like Drupal will be suicide for your site's performance. BTW, Drupal implements precisely zero cache on behalf of custom module devs, so unless you've specifically used cache_get/cache_set, you're not using Drupal core's cache anyway, and this is all moot – Clive Apr 15 '14 at 9:19
  • I Strongly agree with your opinion. With reference to this: "Work out which cache keys from which bins are causing you the problems"; can you suggest some resource where I can read this? -------------------------------- This could be moot, but my errors are fixed as soon I clear Cache. There might be some level up-to which cache might be messing with forms and file management of my module. – imserious Apr 15 '14 at 9:34
  • Forms...yes. File management, not so much. Drupal wouldn't cache that, certainly not with direct intervention. If you have custom forms try using $form['#cache'] = FALSE; if they're causing you issues – Clive Apr 15 '14 at 9:46
  • Alright, let me try that (Yes I have custom forms). This should be inside the function where I define the form having file field or inside submit or validate functions? – imserious Apr 15 '14 at 9:49
  • Yeah, in the form definition function itself – Clive Apr 15 '14 at 9:50
5

As per Suppress caching (for development), you can add the following to your settings.php file

if (!class_exists('DrupalFakeCache')) {
  $conf['cache_backends'][] = 'includes/cache-install.inc';
}
// Default to throwing away cache data
$conf['cache_default_class'] = 'DrupalFakeCache';
// Rely on the DB cache for form caching - otherwise forms fail.
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';

I'd recommend you don't just blindly add that, though. Instead, take the time to think what you do need to cache, and what you don't need to cache, and come up with a proper strategy. For example, it's hardly likely that you need rebuild the cache of hook implementations on every single page load, regardless of how highly available the site is.

| improve this answer | |
0

Theme functions are handled by the theme registry: rebuilding (or worse, disabling) all your site's caches to pick up a new theme function is unnecessary and overkill.

What you can do is use the Devel module to rebuild your theme's registry on every page reload. Once installed, go to Configuration → Development → Devel settings. There, check "Rebuild the theme registry on every page load" and press the "Save configuration" button. Remember to uncheck it (or better yet, disable Devel entirely) when you're done with development.

| improve this answer | |
  • 3
    That covers the theme registry, but what about everything else? There's a lot of caching in Drupal – Clive Apr 15 '14 at 8:42
  • And from OPs use case it seems that theme registry is probably something that does not bother him too much anyway. – Mołot Apr 15 '14 at 8:44
  • Gracias for help. I have updated problem in the question in light of your answers and comments. – imserious Apr 15 '14 at 9:15

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.