Apache mod_deflate 基于url参数

发布于 2024-07-17 10:58:54 字数 52 浏览 5 评论 0原文

apache中的mod_deflate模块可以根据url参数调用,而不是针对所有服务器请求

Can mod_deflate module in apache be invoked based on url parameters and not for all the server requests

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

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

发布评论

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

评论(1

喜你已久 2024-07-24 10:58:54

您的意思是网址中的 ?foo=bar 吗? 也许你可以指定除了 URL 参数等之外你想要做什么——一个小用例。 一般来说,mod_deflate可以通过Apache中的来配置。

更多详细信息请参见此处:
http://httpd.apache.org/docs/2.2/mod/mod_deflate。 当您提供更多背景信息

时,我很乐意扩展我的答案。

更新:使用重写规则使 ?foo=bar 变成 /foo/bar (或类似的 - 无论在您的应用程序中有效) 。 然后使用 匹配并启用 mod_deflate。 但我认为这不太可行。

通常,如果你扩展你的问题,比如你为什么这样做以及你认为收获是什么,我会提出其他建议。

Do you mean, ?foo=bar in your URL? Maybe you could specify what you're trying to do exactly, besides the URL parameters etc. -- a little use case. In general, mod_deflate can be configured with <Directory /> and <Location /> in Apache.

More details here:
http://httpd.apache.org/docs/2.2/mod/mod_deflate.html

I'll be happy to extend my answer, when you provide more background.

UPDATE: Use a rewrite rule to make ?foo=bar turn into /foo/bar (or similar -- whatever works in your app). Then use <Location /> to match and enable mod_deflate. I don't think that's very feasible though.

Usually, I'd advice something else, if you expanded your question as of why you are doing this and what you think the gain is.

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