Ejemplo n.º 1
0
 public static function deleteUserCache($userId = false)
 {
     global $USER;
     if ($userId === false && $USER->IsAuthorized()) {
         $userId = $USER->GetID();
     }
     $userId = intval($userId);
     if ($userId > 0) {
         $postfix = \CHTMLPagesCache::getSpaPostfix();
         $privateKey = self::getUserPrefix($userId);
         foreach ($postfix as $item) {
             $realPrivateKey = \CHTMLPagesCache::getRealPrivateKey($privateKey, $item);
             $staticCache = new StaticHtmlCache("/", null, $realPrivateKey);
             $staticCache->delete();
         }
         header("X-Bitrix-Composite-Delete:" . md5(\CHTMLPagesCache::getHttpHost() . $privateKey));
     }
 }