You are here

function esi_cron in ESI: Edge Side Includes 6.2

Same name and namespace in other branches
  1. 7.3 esi.module \esi_cron()

Implementation of hook_cron(). Every interval, rotate the seed (used to generate the role-cookie). (Each rotation will invalidate the varnish-cache for cached pre-role blocks).

File

./esi.module, line 220
Adds support for ESI (Edge-Side-Include) integration, allowing blocks to be\ delivered by ESI, with support for per-block cache times.

Code

function esi_cron() {
  $age = time() - variable_get('esi_seed_key_last_changed', 0);
  $interval = variable_get('esi_seed_key_rotation_interval', ESI_SEED_ROTATION_INTERVAL);
  if ($age > $interval) {
    require_once drupal_get_path('module', 'esi') . '/esi.inc';
    _esi__rotate_seed_key();
  }
}