[FEATURE] Conditional HTTP GET for Blacklist Downloads (ETag / Last-Modified) #3282#3283
Conversation
…odified) bunkerity#3282 [FEATURE] Conditional HTTP GET for Blacklist Downloads (ETag / Last-Modified) bunkerity#3282
There was a problem hiding this comment.
Pull request overview
This PR implements conditional HTTP GET support (via ETag / Last-Modified headers) for the blacklist download job in BunkerWeb. Instead of performing a full download on every job run after the 1-hour TTL expires, the job now sends If-None-Match or If-Modified-Since headers to allow servers to respond with a lightweight 304 Not Modified. A HEAD-request-based Content-Length comparison is included as a last-resort fallback when neither ETag nor Last-Modified are available. The feature reduces bandwidth, CPU load, and load on upstream list providers.
Changes:
- New
parse_http_metadata()helper to extract ETag, Last-Modified, and Content-Length from cached file headers. - New
build_cache_header()helper to persist HTTP metadata (ETag, Last-Modified, Content-Length) in the cache file's comment header block. - Updated download loop to send conditional GET headers, handle 304 responses by refreshing the cache timestamp, and fall back to a HEAD request + Content-Length comparison when no standard validators are present. Also upgrades several log calls from
warningtoerrorwhere appropriate.
|
Hello @TheophileDiot the PR is ready for code audit and public preview |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 7 minutes and 1 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
[FEATURE] Conditional HTTP GET for Blacklist Downloads (ETag / Last-Modified) #3282