You are here

function esi_cron in ESI: Edge Side Includes 7.3

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

Implementation of hook_cron(). Every interval, rotate the seed (used to generate the context-cookies). (Each rotation will invalidate the varnish-cache for previously-cached contexts).

File

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

Code

function esi_cron() {
  $age_of_current_seed = time() - variable_get('esi_seed_key_last_changed', 0);
  $interval = variable_get('esi_seed_key_rotation_interval', ESI_SEED_ROTATION_INTERVAL);
  if ($age_of_current_seed > $interval) {
    _esi__rotate_seed_key();
  }
}