-
Notifications
You must be signed in to change notification settings - Fork 1.1k
KTOR-7104 Fix saving caches with different vary header #4673
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
Merged
marychatte
merged 3 commits into
main
from
marychatte/KTOR-7104-HttpCache-Cache-isn't-updated-when-Vary-header-for-304-response-matches-but-not-equal-to-Vary-for-200-response
Feb 14, 2025
Merged
Conversation
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
bjhham
approved these changes
Feb 13, 2025
…pdated-when-Vary-header-for-304-response-matches-but-not-equal-to-Vary-for-200-response
bjhham
pushed a commit
that referenced
this pull request
Feb 19, 2025
anton-erofeev
pushed a commit
to anton-erofeev/ktor
that referenced
this pull request
Feb 23, 2025
e5l
added a commit
that referenced
this pull request
Mar 4, 2025
…'s HttpConfiguration object (#4387) * KTOR-7934 Apply fix for Js target * Update version to 3.1.1-SNAPSHOT (#4674) * KTOR-7104 Fix saving caches with different vary header (#4673) * Improve Jetty connection configuration by exposing a builder on the HttpConfiguration object --------- Co-authored-by: Bruce Hamilton <bruce.hamilton@jetbrains.com> Co-authored-by: Osip Fatkullin <osip.fatkullin@jetbrains.com> Co-authored-by: Mariia Skripchenko <61115099+marychatte@users.noreply.github.com> Co-authored-by: Leonid Stashevsky <e5l@users.noreply.github.com>
I'm not sure if this is the same problem as I face, but I have the feeling this didn't fixed the issue. class VaryTest {
private fun server() {
embeddedServer(Netty, port = 4445) {
routing {
get("/cache") {
if (call.request.headers.contains("200")) {
call.response.header("Vary", "X-Requested-With,Accept-Encoding")
call.respondText { "200 OK response" }
} else {
call.response.header("Vary", "X-Requested-With")
call.respond(HttpStatusCode.NotModified, null)
}
}
}
}.start(wait = false)
}
@Test
fun name() = runTest {
launch { server() }
delay(1000) // Fake delay to start the server
val storage = CacheStorage.Unlimited()
val client = httpClient().config {
install(HttpCache) {
publicStorage(storage)
}
}
client.get("http://localhost:4445/cache") {
header("200", "")
header("Accept-Encoding", "gzip,deflate")
}
println("First was successfully")
client.get("http://localhost:4445/cache") {
header("Accept-Encoding", "gzip,deflate")
}
println("We don't get here. Its crashing")
val cache = storage.findAll(Url("http://localhost:4444/cache"))
assert(cache.size == 1) { "Expected 1 but was ${cache.size}" }
}
} This result in:
Dependencies:
|
nevermind, it works as expected. Sorry for spamming 🙃 |
e5l
added a commit
that referenced
this pull request
Apr 17, 2025
…'s HttpConfiguration object (#4387) * KTOR-7934 Apply fix for Js target * Update version to 3.1.1-SNAPSHOT (#4674) * KTOR-7104 Fix saving caches with different vary header (#4673) * Improve Jetty connection configuration by exposing a builder on the HttpConfiguration object --------- Co-authored-by: Bruce Hamilton <bruce.hamilton@jetbrains.com> Co-authored-by: Osip Fatkullin <osip.fatkullin@jetbrains.com> Co-authored-by: Mariia Skripchenko <61115099+marychatte@users.noreply.github.com> Co-authored-by: Leonid Stashevsky <e5l@users.noreply.github.com>
osipxd
added a commit
that referenced
this pull request
May 7, 2025
…'s HttpConfiguration object (#4387) * KTOR-7934 Apply fix for Js target * Update version to 3.1.1-SNAPSHOT (#4674) * KTOR-7104 Fix saving caches with different vary header (#4673) * Improve Jetty connection configuration by exposing a builder on the HttpConfiguration object --------- Co-authored-by: Bruce Hamilton <bruce.hamilton@jetbrains.com> Co-authored-by: Osip Fatkullin <osip.fatkullin@jetbrains.com> Co-authored-by: Mariia Skripchenko <61115099+marychatte@users.noreply.github.com> Co-authored-by: Leonid Stashevsky <e5l@users.noreply.github.com>
bjhham
added a commit
that referenced
this pull request
May 7, 2025
…'s HttpConfiguration object (#4387) * KTOR-7934 Apply fix for Js target * Update version to 3.1.1-SNAPSHOT (#4674) * KTOR-7104 Fix saving caches with different vary header (#4673) * Improve Jetty connection configuration by exposing a builder on the HttpConfiguration object --------- Co-authored-by: Bruce Hamilton <bruce.hamilton@jetbrains.com> Co-authored-by: Osip Fatkullin <osip.fatkullin@jetbrains.com> Co-authored-by: Mariia Skripchenko <61115099+marychatte@users.noreply.github.com> Co-authored-by: Leonid Stashevsky <e5l@users.noreply.github.com>
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.
Subsystem
Client, Cache
Motivation
KTOR-7104
In the issue it's said:
But actually, it shouldn't update the cache as well as it shouldn't respond with cached data because in documentation we can find the next: