constant DRUPAL_NO_CACHE

The block should not get cached.

This setting should be used:

  • For simple blocks (notably those that do not perform any db query), where querying the db cache would be more expensive than directly generating the content.
  • For blocks that change too frequently.

Related topics

16 uses of DRUPAL_NO_CACHE
BlockCacheTestCase::testNoCache in drupal-7.x/modules/block/block.test
Test DRUPAL_NO_CACHE.
BlockInvalidRegionTestCase::testBlockInInvalidRegion in drupal-7.x/modules/block/block.test
Tests that blocks assigned to invalid regions work correctly.
BlockTestCase::testBlockRehash in drupal-7.x/modules/block/block.test
Test _block_rehash().
block_add_block_form_submit in drupal-7.x/modules/block/block.admin.inc
Form submission handler for block_add_block_form().
block_block_info in drupal-7.x/modules/block/block.module
Implements hook_block_info().

... See full list

File

drupal-7.x/includes/common.inc, line 127
Common functions that many Drupal modules will need to reference.

Code

define('DRUPAL_NO_CACHE', -1)