How to make gzip work on 1and1 shared host WordPress site

前端 未结 6 2035
温柔的废话
温柔的废话 2021-01-05 02:15

YSlow is telling me that my css should be compressed, but after several hours of tinkering, I cannot for the life of me get gzip to work for my website. At this point, I\'m

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-05 02:58

    It looks to me like you have exhausted your option. Looking at the above it seems like the host indeed doesn't have mod_deflate or mod_gzip. So I guess you are just out of luck.

    The PHP solution is indeed only for the HTML. So just stick with that one. HTML is also the best place to add compression, as, most of the time, the CSS and JS are only downloaded on the first page.

    You could redirect the request to CSS and JS though a PHP script, and use the PHP to compress. But I would not go there, as you would also have to implement 304 Not modified and set the appropriate expires headers.

提交回复
热议问题