如何让 Lighttpd 压缩 CodeIgniter 的“干净的 URL”?

发布于 2024-08-25 05:33:00 字数 224 浏览 6 评论 0原文

我在测试网站上查看 PageSpeed,发现 Lighttpd 没有压缩我的 HTML(而是压缩我的 javascript 和 css 文件)。我假设这是因为我使用的是 CodeIgniter 并且它是干净的 url 系统,并且由于请求没有文件扩展名,Lighttpd 没有压缩它的规则。既然如此,我如何让 Lighttpd 压缩我的 HTML?

这是我不应该做的事吗?或者我需要专门配置 Lighttpd 来做什么?

I was looking at PageSpeed on my test website and noticed that Lighttpd wasn't compressing my HTML (but was compressing my javascript and css files). I'm assuming this is because I'm using CodeIgniter and it's clean url system and since the requests don't have file extensions, Lighttpd doesn't have the rule to compress it. That being the case, how do I get Lighttpd to compress my HTML?

Is this something I shouldn't be doing? Or something I need to specially configure Lighttpd for?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不弃不离 2024-09-01 05:33:01

我找到了答案。如果您使用的是 1.4.x,则必须安装 mod_deflate 补丁并使用 mod_deflate(默认情况下在 1.5 中可用)。完成此操作后,您将启用同步刷新,然后就可以开始了。

有关如何执行此操作的说明,请阅读更多信息: http://redmine.lighttpd.net/wiki /1/Mod_Deflate

I found the answer. If you are using 1.4.x you have to install the mod_deflate patch and use mod_deflate (which will be available by default in 1.5). Once you've done this you enable sync-flush and you're good to go.

For instructions on how to do this read more at: http://redmine.lighttpd.net/wiki/1/Mod_Deflate

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文