Gzip compresses dynamic content with symfony2

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

Based on http://developer.yahoo.com/performance/rules.html#gzip this seems like a good idea.

+4
source share
1 answer

If you are using Apache httpd, then this is pretty simple. Just include the mod_deflate module in httpd.conf and add the AddOutputFilterByType lines for different types (more details here: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html ). I do not believe that symfony2 can gzip something by itself, since this is usually work for a web server.

+7
source

Source: https://habr.com/ru/post/1411411/


All Articles