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

KTOR-7830 HttpCache may cache response before its transformation #4519

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

osipxd
Copy link
Member

@osipxd osipxd commented Nov 29, 2024

Subsystem
Client

Motivation
KTOR-7830 Installing HttpCache before ContentEncoding prevents response body to be decoded

Solution
The problem is that both HttpCache and ContentEncoding use phase HttpReceivePipeline.State to handle responses, so installation order matters here. I've changed HttpCache plugin to operate in an additional phase after State phase, when all response transformations should be already applied.

@osipxd osipxd self-assigned this Nov 29, 2024
@osipxd osipxd force-pushed the osipxd/httpcache-after-transformations branch 2 times, most recently from 44d78e9 to 2cbe4a4 Compare December 5, 2024 22:29
@osipxd osipxd marked this pull request as draft December 5, 2024 23:22
@osipxd osipxd force-pushed the osipxd/httpcache-after-transformations branch from 2cbe4a4 to d86942b Compare December 9, 2024 15:18
@osipxd osipxd marked this pull request as ready for review December 9, 2024 15:18
@osipxd osipxd requested a review from bjhham December 9, 2024 15:18
Copy link
Contributor

@bjhham bjhham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! The unexpected interactions between plugins is a never-ending source of stress.

@osipxd osipxd force-pushed the osipxd/httpcache-after-transformations branch from 6bb375f to c3cce56 Compare December 11, 2024 14:33
@osipxd osipxd enabled auto-merge (squash) December 11, 2024 14:34
@osipxd osipxd disabled auto-merge December 11, 2024 14:37
@osipxd osipxd enabled auto-merge (squash) December 11, 2024 14:55
@osipxd osipxd merged commit c24c734 into main Dec 11, 2024
14 of 16 checks passed
@osipxd osipxd deleted the osipxd/httpcache-after-transformations branch December 11, 2024 15:37
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

Successfully merging this pull request may close these issues.

2 participants