-
Notifications
You must be signed in to change notification settings - Fork 4.9k
prefix_rewrite
not being respected with caching enabled in Envoy 1.33
#39135
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
Comments
I think that technically this will still get the right lookups as key_ stores the path on the request. However if any other header mutations take place and they affect a vary header then I think you could get to a space where some get responses would be cached but never retrieved from cache right? |
I haven't thought too much about the implications for the process of performing the caching operation itself. I was thinking more about how this affects upstreams, since they will be serving different requests based on the version of Envoy that is used (ie. |
cc @toddmgreer @jmarantz @penguingao @mpwarres @capoferro as codeowners |
Would highly recommend not using the cache filter at all until the new version lands. Before or after that commit (which you are correct to call out as the cause), it's a disaster, in different ways. The new version (#37990) is also a disaster, that will require weird custom configuration to get it to do anything sensible, but it at least can be coaxed into doing something sensible. The whole premise of trying to fit cache behavior into the constraints of an envoy filter is unfortunately a bad one. I also would not recommend waiting for the new version of the filter because its rate of progress is glacial, so my recommendation at this time would be to either do caching some other way, or don't do caching at all. Possible workarounds at this time if you really want to use the cache filter (which are also what will likely end up being needed with the new version) involve routing through an internal listener; you could either:
Both of these options are a pain and will interfere with other things that other filters do, if you have a complicated filter chain. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions. |
@ravenblackx,
Regarding the glacial pace: once this PR merges, would you be willing to
become a CacheFilter owner, so I can get out of the way of progress?
(RavenBlackx is too polite to say this, but the glacial pace is my fault,
and I need to get out of his way.)
…On Sat, May 24, 2025, 7:05 PM github-actions[bot] ***@***.***> wrote:
*github-actions[bot]* left a comment (envoyproxy/envoy#39135)
<#39135 (comment)>
This issue has been automatically closed because it has not had activity
in the last 37 days. If this issue is still valid, please ping a maintainer
and ask them to label it as "help wanted" or "no stalebot". Thank you for
your contributions.
—
Reply to this email directly, view it on GitHub
<#39135 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFRAWPLBDYFLCLERBPEIQG33AECMDAVCNFSM6AAAAAB3GNJ5CKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMBXGUYTENZSGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Uh oh!
There was an error while loading. Please reload this page.
If you are reporting any crash or any potential security issue, do not
open an issue in this repo. Please report the issue via emailing
envoy-security@googlegroups.com where the issue will be triaged appropriately.
Title:
prefix_rewrite
not being respected with caching enabled in Envoy 1.33Description:
As of Envoy 1.33 and above, when caching is enabled on a filter chain, the
prefix_rewrite
configuration on the route is not being respected. Requests to the upstream are coming in with the original path provided by the downstream client instead.I'm fairly certain this behaviour was introduced in this commit.
Repro steps:
Run an echo server on port 8090 (
docker run -p 8090:8080 -e LOG_HTTP_HEADERS=true -e LOG_HTTP_BODY=true jmalloc/echo-server
) and run Envoy with the below configuration.GET / HTTP/1.1
(which is correct).GET /test HTTP/1.1
which is incorrect (/test
should be removed in accordance with theprefix_rewrite
configuration on the route).envoy.filters.http.cache
filter is removed from the configuration, then Envoy 1.33 behaves the same as 1.32 (the upstream correctly sees/
and not/test
).The text was updated successfully, but these errors were encountered: