vendor/contao/core-bundle/src/Resources/contao/classes/FragmentTemplate.php line 36

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Contao.
  4.  *
  5.  * (c) Leo Feyer
  6.  *
  7.  * @license LGPL-3.0-or-later
  8.  */
  9. namespace Contao;
  10. use Contao\CoreBundle\EventListener\SubrequestCacheSubscriber;
  11. use Symfony\Component\HttpFoundation\Response;
  12. class FragmentTemplate extends FrontendTemplate
  13. {
  14.     /**
  15.      * Return a response object
  16.      *
  17.      * @return Response The response object
  18.      */
  19.     public function getResponse($blnCheckRequest=false$blnForceCacheHeaders=false)
  20.     {
  21.         $response parent::getResponse();
  22.         // Mark this response to affect the caching of the current page but remove any default cache headers
  23.         $response->headers->set(SubrequestCacheSubscriber::MERGE_CACHE_HEADERtrue);
  24.         $response->headers->remove('Cache-Control');
  25.         return $response;
  26.     }
  27.     protected function compile()
  28.     {
  29.         $this->strBuffer $this->parse();
  30.     }
  31. }