Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Implement HTTP 304 Caching w/ Rule Set and Subscription #819

Open
3 tasks done
SukkaW opened this issue Jan 26, 2025 · 0 comments
Open
3 tasks done

[Feature] Implement HTTP 304 Caching w/ Rule Set and Subscription #819

SukkaW opened this issue Jan 26, 2025 · 0 comments

Comments

@SukkaW
Copy link

SukkaW commented Jan 26, 2025

verify

  • 我已经仔细阅读项目文档,确认现有功能无法解决我的需求
  • 我已经检索过现有issue,确认与现有issue的内容并不重复
  • 我已经尝试自行解决,确认自己没有能力解决

功能描述

As the maintainer of the SukkaW/Surge, I maintain the ruleset.skk.moe to deliver the rule sets.

It turns out that the ruleset.skk.moe served more than 187.25 GiB data over the past 30 days, among them clients with source User-Agent containing subconverter received 46.9 GiB data, accounting for 25.04% of all the traffic.

可能的解决方案

By storing the ETag response header, it is possible to include the request header "If-None-Match" with the previously stored ETag value in future requets. If the remote returns a 304 HTTP status code, the download could be skipped and the previous cache can be re-used.

Currently, GitHub RAW, jsDelivr, and ruleset.skk.moe all return the ETag response header. By implementing support for these HTTP headers, Stash could efficiently check for updates and only download changes, significantly benefiting both rule maintainers and users by reducing both ends' bandwidth usage.

Other popular applications in this space, such as Surge, Stash, Clash.Meta (Mihomo), Shadowrocket, and Surfboard have already adopted this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant