symfonyhttp-headersuser-agentvary

How to set up Vary HTTP header in Symfony2 web app?


In my Symfony2 web app, I need to set up Vary HTTP header for User-Agent, like in this link,

https://developers.google.com/webmasters/smartphone-sites/details?hl=en

Does any know how to do this ?


Solution

  • You can use the @Cache annotation, or you can set headers directly on a Response object.

    http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/cache.html