[FEATURE] Conditional HTTP GET for Blacklist Downloads (ETag / Last-Modified) #3282#3283
Open
mkf-sysangels wants to merge 3 commits intobunkerity:devfrom
Conversation
…odified) bunkerity#3282 [FEATURE] Conditional HTTP GET for Blacklist Downloads (ETag / Last-Modified) bunkerity#3282
Contributor
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[FEATURE] Conditional HTTP GET for Blacklist Downloads (ETag / Last-Modified) #3282