How do I completely disable cache?

别说谁变了你拦得住时间么 提交于 2019-12-09 14:42:38

问题


Drupal 6's cache can be set to disabled, normal or aggressive. I cannot find these options for my Drupal 7 installation. There is only a button that flushes all the cache but it has to be clicked for every change I made to a module or a template. By change I mean adding some HTML tags to a module or a template.

Thanks to mirzu's response, I already installed the devel module but it doesn't work either. The only way I get so see my changes is by disabling and enabling the module.

The hello.module looks like:

function annotate_menu() {
  $items = array();
  $items['hello'] = array(
    'title'            => t('Hello world'),
    'page callback'    => 'hello_output',
    'access arguments' => array('access content'),
  );

  return $items;
}

function hello_output() {
  header('Content-type: text/plain; charset=UTF-8');
  header('Content-Disposition: inline');
  return 'annotate';
}

The template page-hello.tpl.php contains print $content;.

I access the page through http://localhost/test/hello.


回答1:


Completely disable the cache and use the devel module and check the box that reads "rebuild the cache registry on each page load."




回答2:


There are many different levels of caching involved.

  • The menu system is not actually a cache. If you change anything in hook_menu(), you need to rebuild it. devel.module provides a handy link for that in the development block.

  • Additionally, Drupal also caches hook implementation and many other things, which you can clear with another link in the development block or if you have drush installed, with "drush cc all". There is also a way to disable it completely but that could make your site quite slow: http://drupal.org/node/797346




回答3:


In Drupal 7, you can check the 'Rebuild the theme registry on every page load' option in the configuration page (admin/config/development/devel) of the Devel module.



来源:https://stackoverflow.com/questions/4892573/how-do-i-completely-disable-cache

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!