Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I completely disable cache?

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.

like image 783
jdecuyper Avatar asked Feb 03 '11 22:02

jdecuyper


People also ask

What happens if you disable cache?

Along the top of the network panel, there's a checkbox that says “Disable Caching.” This disables browser-level caching, but only as long as the DevTools are open. So it won't affect your normal browsing, but while working with the developer tools you won't have to worry about stale content.

How do I bypass cache in Chrome?

Chrome, Firefox, or Edge for Windows: Press Ctrl+F5 (If that doesn't work, try Shift+F5 or Ctrl+Shift+R). Chrome or Firefox for Mac: Press Shift+Command+R.

Can you delete all the cache?

On your Android phone or tablet, open the Chrome app . At the top right, tap More . Tap History Clear browsing data.


1 Answers

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

like image 123
mirzu Avatar answered Oct 07 '22 01:10

mirzu