feat: Implement basic HTTP caching with ETag and Last-Modified#5
Merged
nuclearcat merged 2 commits intokernelci:mainfrom Aug 8, 2025
Merged
feat: Implement basic HTTP caching with ETag and Last-Modified#5nuclearcat merged 2 commits intokernelci:mainfrom
nuclearcat merged 2 commits intokernelci:mainfrom
Conversation
|
RFC9110 explains the purpose of this headers and their handling: https://www.rfc-editor.org/rfc/rfc9110.html#name-if-none-match |
| } | ||
| } | ||
| // Does request have If-Modified-Since header? | ||
| if let Some(if_modified_since) = rxheaders.get("If-Modified-Since") { |
There was a problem hiding this comment.
According to RFC9110 the If-Modified-Since should be ignored if If-None-Match is present.
A recipient MUST ignore If-Modified-Since if the request contains an If-None-Match header field; the condition in If-None-Match is considered to be a more accurate replacement for the condition in If-Modified-Since, and the two are only combined for the sake of interoperating with older intermediaries that might not implement If-None-Match
acf5a7c to
64f03c9
Compare
This commit introduces handling for `If-None-Match` and `If-Modified-Since` headers. - Adds `ETag` and `Last-Modified` headers to the response. - Checks for `If-None-Match` and `If-Modified-Since` in the request headers. - Returns a `304 Not Modified` response if the cache is still valid. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
64f03c9 to
18e62d8
Compare
The Docker image name in the build workflow was pointing to a personal repository instead of the official KernelCI repository. This commit corrects the image name to `ghcr.io/kernelci/kernelci-storage`.
Member
Author
|
I did few adjustments also for RFC9110 compliance. |
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.
This commit introduces handling for
If-None-MatchandIf-Modified-Sinceheaders.ETagandLast-Modifiedheaders to the response.If-None-MatchandIf-Modified-Sincein the request headers.304 Not Modifiedresponse if the cache is still valid.