Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SurrogateInterface.php

interface SurrogateInterface

Hierarchy

  • interface \Symfony\Component\HttpKernel\HttpCache\SurrogateInterface

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.
     */
    public function getName() : string;
    
    /**
     * Returns a new cache strategy instance.
     */
    public function createCacheStrategy() : ResponseCacheStrategyInterface;
    
    /**
     * Checks that at least one surrogate has Surrogate capability.
     */
    public function hasSurrogateCapability(Request $request) : bool;
    
    /**
     * Adds Surrogate-capability to the given Request.
     */
    public function addSurrogateCapability(Request $request) : void;
    
    /**
     * 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.
     */
    public function addSurrogateControl(Response $response) : void;
    
    /**
     * Checks that the Response needs to be parsed for Surrogate tags.
     */
    public function needsParsing(Response $response) : bool;
    
    /**
     * Renders a Surrogate tag.
     *
     * @param string|null $alt     An alternate URI
     * @param string      $comment A comment to add as an esi:include tag
     */
    public function renderIncludeTag(string $uri, ?string $alt = null, bool $ignoreErrors = true, string $comment = '') : string;
    
    /**
     * Replaces a Response Surrogate tags with the included resource content.
     */
    public function process(Request $request, Response $response) : Response;
    
    /**
     * Handles a Surrogate from the cache.
     *
     * @param string $alt An alternative URI
     *
     * @throws \RuntimeException
     * @throws \Exception
     */
    public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors) : string;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
SurrogateInterface::addSurrogateCapability public function Adds Surrogate-capability to the given Request. 1
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. 1
SurrogateInterface::getName public function Returns surrogate name. 2
SurrogateInterface::handle public function Handles a Surrogate from the cache. 1
SurrogateInterface::hasSurrogateCapability public function Checks that at least one surrogate has Surrogate capability. 1
SurrogateInterface::needsParsing public function Checks that the Response needs to be parsed for Surrogate tags. 1
SurrogateInterface::process public function Replaces a Response Surrogate tags with the included resource content. 2
SurrogateInterface::renderIncludeTag public function Renders a Surrogate tag. 2

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal