gzip compress dynamic content with symfony2

后端 未结 1 1309
野趣味
野趣味 2021-01-20 09:55

Is it easy/possible to tell symfony2 to respect the \"Accept-Encoding\" header sent by web browsers and (if possible) gzip-compress rendered content in the response?

相关标签:
1条回答
  • 2021-01-20 10:15

    If you are using Apache httpd, then it is quite easy - Just enable the mod_deflate module in the httpd.conf and add AddOutputFilterByType lines for the different types (more info here: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html). I do not believe that symfony2 can gzip something by itself, as this is normally a job for the web server.

    0 讨论(0)
提交回复
热议问题