How to turn on gzip compression for symfony2 site?

后端 未结 1 1687
说谎
说谎 2021-02-09 03:39

I am using servergrove for my site hosting but they sure lack staff that would help me. How do I setup gzip compression for symfony2 site?

If possible, in an idiot-proof

相关标签:
1条回答
  • 2021-02-09 03:45

    I add the following into my .htaccess in the web folder.

    <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/css
        AddOutputFilterByType DEFLATE text/javascript
        AddOutputFilterByType DEFLATE application/x-javascript
        AddOutputFilterByType DEFLATE application/javascript
        AddOutputFilterByType DEFLATE text/x-component
        AddOutputFilterByType DEFLATE text/html
        AddOutputFilterByType DEFLATE text/richtext
        AddOutputFilterByType DEFLATE image/svg+xml
        AddOutputFilterByType DEFLATE text/plain
        AddOutputFilterByType DEFLATE text/xsd
        AddOutputFilterByType DEFLATE text/xsl
        AddOutputFilterByType DEFLATE text/xml
        AddOutputFilterByType DEFLATE image/x-icon
        AddOutputFilterByType DEFLATE application/json
    </IfModule>
    

    Can't remember for the life of me where I originally got it from.

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