- * Returns a new cache strategy instance.
- *
- * @return ResponseCacheStrategyInterface A ResponseCacheStrategyInterface instance
- */
- public function createCacheStrategy()
- {
- return new ResponseCacheStrategy();
- }
-
- /**
- * Checks that at least one surrogate has ESI/1.0 capability.
- *
- * @param Request $request A Request instance
- *
- * @return bool true if one surrogate has ESI/1.0 capability, false otherwise
- */
- public function hasSurrogateCapability(Request $request)
- {
- if (null === $value = $request->headers->get('Surrogate-Capability')) {
- return false;
- }
-
- return false !== strpos($value, 'ESI/1.0');
- }
-
- /**
- * Checks that at least one surrogate has ESI/1.0 capability.
- *
- * @param Request $request A Request instance
- *
- * @return bool true if one surrogate has ESI/1.0 capability, false otherwise
- *
- * @deprecated since version 2.6, to be removed in 3.0. Use hasSurrogateCapability() instead
- */
- public function hasSurrogateEsiCapability(Request $request)
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the hasSurrogateCapability() method instead.', E_USER_DEPRECATED);
-
- return $this->hasSurrogateCapability($request);
- }
-
- /**
- * Adds ESI/1.0 capability to the given Request.
- *
- * @param Request $request A Request instance
- */
- public function addSurrogateCapability(Request $request)
- {
- $current = $request->headers->get('Surrogate-Capability');
- $new = 'symfony2="ESI/1.0"';
-
- $request->headers->set('Surrogate-Capability', $current ? $current.', '.$new : $new);
- }
-
- /**
- * Adds ESI/1.0 capability to the given Request.
- *
- * @param Request $request A Request instance
- *
- * @deprecated since version 2.6, to be removed in 3.0. Use addSurrogateCapability() instead
- */
- public function addSurrogateEsiCapability(Request $request)
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the addSurrogateCapability() method instead.', E_USER_DEPRECATED);
-
- $this->addSurrogateCapability($request);
- }
-
- /**
- * Adds HTTP headers to specify that the Response needs to be parsed for ESI.
- *
- * This method only adds an ESI HTTP header if the Response has some ESI tags.
- *
- * @param Response $response A Response instance