Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在网站上设置 gzip 压缩,但我们不确定它将托管在哪里,我希望能够支持 mod_gzip(如果可用)。
我想做的是这样的:
<IfModule mod_gzip.c> # mod_gzip rules <IfOtherModule mod_deflate.c> # mod_deflate rules </IfModule>
apache configs 允许这样做吗?如果 mod_gzip 已经完成了它的工作, mod_deflate 是否足够聪明以至于不能工作?
<IfModule mod_gzip.c> # mod_gzip rules </IfModule> <IfModule !mod_gzip.c> <IfModule mod_deflate.c> # mod_deflate rules </IfModule> </IfModule>
虽然我会改变顺序并首先尝试 mod_defate。mod_gzip 不再处于开发阶段,因此您最好使用 mod_deflate(顺便说一下,它也使用 gzip,而不是 deflate,正如其名称所暗示的那样)。