Apache:缓存 DEFLATE 文件
让 zlib 在每个请求期间压缩网页似乎是多余的。 这也是我的文件响应时间的瓶颈。 有没有办法缓存 zlib 文件,以便每次修改时只压缩一次? 还是我应该继续许愿?
It seems redundant to have zlib compress a web page during every request. It is also the bottleneck of my files' response times. Is there a way to cache the zlib'd file so that it is compressed only once at each modification? Or should I just keep wishing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想要一个快速而懒惰的解决方案,只需制作最常用文件的 gzip 副本,然后将
如果可能的话,您也可以考虑使用 Lighttpd 而不是 Apache。 它有一个 mod_compress 可以完全满足您的需求。
If you want a quick and lazy solution, just make gzipped copies of your most used files and turn MultiViews on for them. This still has CPU overhead to calculate the right file to send but it's less than a gzip every time. If you want to take it further you can create static type-map files.
Also you could consider using Lighttpd if possible instead of Apache. It has a mod_compress which does exactly what you want.
嗯,我认为 mod_cache 可以完成这项工作。 http://httpd.apache.org/docs/2.0/mod/mod_cache。 html
Hm, I think mod_cache will do the job. http://httpd.apache.org/docs/2.0/mod/mod_cache.html