wse-1.0.x-dev/modules/wse_preview/src/PageCache/DisallowWorkspacePreviewRequests.php

modules/wse_preview/src/PageCache/DisallowWorkspacePreviewRequests.php
<?php

namespace Drupal\wse_preview\PageCache;

use Drupal\Core\PageCache\RequestPolicyInterface;
use Symfony\Component\HttpFoundation\Request;

/**
 * Cache policy for pages served from workspace previews.
 */
class DisallowWorkspacePreviewRequests implements RequestPolicyInterface {

  /**
   * {@inheritdoc}
   */
  public function check(Request $request) {
    // Ensure that pages accessed through workspace previews are not cached.
    if ($request->cookies->has('wse_preview')) {
      return self::DENY;
    }
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc