symfony 3 4 cache control

Solutions on MaxInterview for symfony 3 4 cache control by the best coders in the world

showing results for - "symfony 3 4 cache control"
Darby
26 Feb 2017
1<?php
2
3namespace AppBundle\Listener;
4
5use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
6
7class ResponseListener
8{
9    public function onKernelResponse(FilterResponseEvent $event)
10    {
11        $response = $event->getResponse();
12
13        $controller = $event->getRequest()->attributes->get('_controller');
14        $requiredAssetAction = "AppBundle\Controller\Website\AssetsController::assetAction";
15
16        if ($controller == $requiredAssetAction) {
17            $response->headers->addCacheControlDirective('max-age', 900);
18            $response->headers->addCacheControlDirective('s-maxage', 900);
19            $response->headers->addCacheControlDirective('must-revalidate', true);
20            $response->headers->addCacheControlDirective('public', true);
21            $response->headers->removeCacheControlDirective('private');
22
23        }
24
25        $event->setResponse($response);
26    }
27
28}
queries leading to this page
symfony retrieve http cache storesymfony 3 clear cache commandsymfony command cachesymfony 3 4 cache symfonysymfony annotations cachesymfony 4 doctrine cachesymfony cache control header no cachesymfony cachesymfony doctrine cacheclear cache symfony 3 4symfony dont perform cachesymfony form without cache simple cache symfonysymfony cache packagecomposer install symfony cachecomposer symfony cachesymfony 3 clear cachesymfony 4 cache clear errorsymfony 3 4 cache control symfony cloud cachecache symfony 4 4symfony remove cache controlsymfony do add cache annotationsymfony cache http responsesymfony cache how to usedoctrine cache symfony 5 24response 3esetsharedmaxage 283600 29 3bsymfony set response header cache controlsymfony service get cacheget cache symfony 4 4symfony 3 4 cache clearsymfony set cache control headersymfony supported cachefile cache symfonysymfony cache documentationsymfony cache http requestsymfony 1 4 cache clearsymfony 5 clear cache manuallysymfony cache keypage de cache symfonysymfony add http cache controlclass cache symfonygenerate cache symfony from command lineclear cache symfony 3symfony 4 doctrine cache bundlesymfony 5 cache control always 0symfony file system cache tutorialsymfony 4 clear cachecache container symfonysymfony cache header nog workingsymfony 4 http cache bundlesymfony cache examplecache symfony 4 4 componenthandle cache symfonysymfony cache get cache timehttp cache symfonysymfony 5 cache header not workingsymfony 5 cachesymfony 2 cache servicecache component symfonyclear cache symfony 5symfony finder cachecache symfony problemsymfony caching resonsesymfony cache formssymfony item cachesymfony configure doctrine cachesymfony 5 clear cachesymfony 4 clear cache commandsymfony 4 rest api cachessymfony https no cache symfony 4 cache response headersymfony cache header nogt workingsymfony cache add data to cachesymfony cache itemsymfony work without using cachesymfony set header cache controlphp symfony 1 4 cache put timesymfony 4 4 cachesymfony cache interface getsymfony cache controllersymfony cache control return privatecache clear symfony 3 3symfony cache pagesymfony cache tutorialsymfony container cachesymfony only set cachesymfony 4 disable cachesymfony cache bundlephp cache symfony htmlsymfony https cache issuesymfony cache control headersymfony http client cacheclean cache symfony in controllersymfony 3 2 cache 40cache symfonysymfony config cacheclear cache symfony 1 4symfony 3 2 http cachecache symfonysymfony set cachesymfony render from no cacheclear symfony 5 cachesymfony cache servucesymfony cache 3econtainssymfony 4 clear cache from controllersymfony cache problemscache clear symfony 3 4symfony cache components testssymfony cache config optionswhat are cache system in symfonysymfony cache de 7esymfony disable cache for routehttp cache symfony 4 examplesymfony cache configurationcomposer require symfony cachesymfony cache interfacecache get symfonysymfony dont cachesymfony get simple cache servicesymfony no cachesymfony http cachesymfony cache warmupsymfony cache controlsymfony 5 cache clearsymfony cache de symfony 2 8 cache clearsymfony cache pluginsymfony 2 cachesymfony cache symfony no cache headersymfony type de cache doctrinesymfony caching a pagesymfony cache componentsymfony cache managersymfony generate cachecache clear symfony 4implement symfony cachesymfony create cache managersymfony 3 4 cache control