How to Specify “Vary: Accept-Encoding” header in .htaccess

前端 未结 7 1319
情话喂你
情话喂你 2020-12-12 10:34

Google PageSpeed says I should \"Specify a Vary: Accept-Encoding header\" for JS and CSS. How do I do this in .htaccess?

相关标签:
7条回答
  • 2020-12-12 11:22

    I'm afraid Aularon didn't provide enough steps to complete the process. With a little trial and error, I was able to successfully enable Gzipping on my dedicated WHM server.

    Below are the steps:

    • Run EasyApache within WHM, select Deflate within the Exhaustive Options list, and rebuild the server.

    • Once done, goto Services Configuration >> Apache Configuration >> Include Editor >> Post VirtualHost Include, select All Versions, and then paste the mod_headers.c and mod_headers.c code (listed above in Aularon's post) on top of on another within the input field.

    • Once saved, I was seeing a 75.36% data savings on average! You can run a before and after test by using this HTTP Compression tool to see your own results: http://www.whatsmyip.org/http_compression/

    Hope this works for you all!

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