You are here

interface SurrogateInterface in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/HttpCache/SurrogateInterface.php \Symfony\Component\HttpKernel\HttpCache\SurrogateInterface

Hierarchy

Expanded class hierarchy of SurrogateInterface

All classes that implement SurrogateInterface

2 files declare their use of SurrogateInterface
AbstractSurrogateFragmentRenderer.php in vendor/symfony/http-kernel/Fragment/AbstractSurrogateFragmentRenderer.php
SurrogateListener.php in vendor/symfony/http-kernel/EventListener/SurrogateListener.php

File

vendor/symfony/http-kernel/HttpCache/SurrogateInterface.php, line 17

Namespace

Symfony\Component\HttpKernel\HttpCache
View source
interface SurrogateInterface {

  /**
   * Returns surrogate name.
   *
   * @return string
   */
  public function getName();

  /**
   * Returns a new cache strategy instance.
   *
   * @return ResponseCacheStrategyInterface A ResponseCacheStrategyInterface instance
   */
  public function createCacheStrategy();

  /**
   * Checks that at least one surrogate has Surrogate capability.
   *
   * @param Request $request A Request instance
   *
   * @return bool true if one surrogate has Surrogate capability, false otherwise
   */
  public function hasSurrogateCapability(Request $request);

  /**
   * Adds Surrogate-capability to the given Request.
   *
   * @param Request $request A Request instance
   */
  public function addSurrogateCapability(Request $request);

  /**
   * Adds HTTP headers to specify that the Response needs to be parsed for Surrogate.
   *
   * This method only adds an Surrogate HTTP header if the Response has some Surrogate tags.
   *
   * @param Response $response A Response instance
   */
  public function addSurrogateControl(Response $response);

  /**
   * Checks that the Response needs to be parsed for Surrogate tags.
   *
   * @param Response $response A Response instance
   *
   * @return bool true if the Response needs to be parsed, false otherwise
   */
  public function needsParsing(Response $response);

  /**
   * Renders a Surrogate tag.
   *
   * @param string $uri          A URI
   * @param string $alt          An alternate URI
   * @param bool   $ignoreErrors Whether to ignore errors or not
   * @param string $comment      A comment to add as an esi:include tag
   *
   * @return string
   */
  public function renderIncludeTag($uri, $alt = null, $ignoreErrors = true, $comment = '');

  /**
   * Replaces a Response Surrogate tags with the included resource content.
   *
   * @param Request  $request  A Request instance
   * @param Response $response A Response instance
   *
   * @return Response
   */
  public function process(Request $request, Response $response);

  /**
   * Handles a Surrogate from the cache.
   *
   * @param HttpCache $cache        An HttpCache instance
   * @param string    $uri          The main URI
   * @param string    $alt          An alternative URI
   * @param bool      $ignoreErrors Whether to ignore errors or not
   *
   * @return string
   *
   * @throws \RuntimeException
   * @throws \Exception
   */
  public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors);

}

Members

Namesort descending Modifiers Type Description Overrides
SurrogateInterface::addSurrogateCapability public function Adds Surrogate-capability to the given Request. 2
SurrogateInterface::addSurrogateControl public function Adds HTTP headers to specify that the Response needs to be parsed for Surrogate. 2
SurrogateInterface::createCacheStrategy public function Returns a new cache strategy instance. 2
SurrogateInterface::getName public function Returns surrogate name. 2
SurrogateInterface::handle public function Handles a Surrogate from the cache. 2
SurrogateInterface::hasSurrogateCapability public function Checks that at least one surrogate has Surrogate capability. 2
SurrogateInterface::needsParsing public function Checks that the Response needs to be parsed for Surrogate tags. 2
SurrogateInterface::process public function Replaces a Response Surrogate tags with the included resource content. 2
SurrogateInterface::renderIncludeTag public function Renders a Surrogate tag. 2