-
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. |
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
[email protected] 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: