如何在Symfony2 Web应用程序中设置Vary HTTP标头?

时间:2014-08-08 09:10:55

标签: symfony http-headers user-agent vary

在我的Symfony2网络应用程序中,我需要为User-Agent设置Vary HTTP标头,就像在此链接中一样,

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

有人知道怎么做吗?

1 个答案:

答案 0 :(得分:1)

您可以使用@Cache注释,也可以直接在Response对象上设置标题。

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

相关问题