You are here

function expire_user_update in Cache Expiration 7

Same name and namespace in other branches
  1. 7.2 expire.module \expire_user_update()

Implements hook_user_update

Acts on user account updates

File

./expire.module, line 199
Provides logic for page cache expiration

Code

function expire_user_update(&$edit, $account, $category = NULL) {

  // Return if no user id is attached to the user object.
  if (empty($account->uid)) {
    return;
  }

  // Expire the relevant user page from the static page cache to prevent serving stale content.
  $paths[] = 'user/' . $account->uid;
  $flushed = expire_cache_derivative($paths, $account);
  watchdog('expire', 'User !uid was updated resulting in !flushed pages being expired from the cache', array(
    '!uid' => $account->uid,
    '!flushed' => $flushed,
  ));
}