Skip to content

Conversation

ravenblackx
Copy link
Contributor

@ravenblackx ravenblackx commented Sep 19, 2025

Commit Message: Add HttpCache version 2
Additional Description: This is essentially just moving #37990 into a new namespace. In addition to simple renames, some factory functions were changed from using throw to returning StatusOr, allowed_vary_headers was hidden as not implemented, and the whole API was tagged WIP as the old version always should have been. There was also a side-effect that the protobuf stableHashKey value for a given cache entry changed because the proto message full-names changed; I bumped the file system cache version so that pre-existing cache entries will be invalidated.

From #37990 the improved features of this new cache implementation are:

  • Thundering-herd resistance (shared streaming from the upstream for cacheable responses)
  • vary headers are unsupported temporarily, rather than broken-supported as they were before.
  • Range requests now provoke a full upstream request to populate the cache, rather than just passing through and never caching. This may be worse for use-cases that would benefit from partial caching, but neither version supported partial caching.
  • A lot of work that used to be required of the cache implementation is now part of the cache filter, so cache implementations can be much simpler - essentially just storage now, no need to understand and process vary headers.
  • Headers and trailers are temporarily cached in memory as well as in the cache storage.
  • More test coverage. Old cache implementation has an exception in the allowable test coverage file.

And the big dubious feature is:

  • Cache requests to upstream now bypass any filters that are upstream of the cache filter and aren't on the cluster, including e.g. the router filter where add_headers operations would be applied. Some awkward configuration is required (and documented) to work around this constraint. Unfortunately the constraint was unavoidable with how envoy works at this time.

Risk Level: Very low since it doesn't change existing APIs and only adds a WIP no-security-posture filter, don't use it!
Testing: Loads.
Docs Changes: Mostly-duplicate docs for the new version.
Release Notes: Follow shortly.
Platform Specific Features: No windows support for file system cache, same as before.

Signed-off-by: Raven Black <[email protected]>
@repokitteh-read-only repokitteh-read-only bot added api deps Approval required for changes to Envoy's external dependencies labels Sep 19, 2025
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).
CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @RyanTheOptimist

🐱

Caused by: #41148 was opened by ravenblackx.

see: more, trace.

@ravenblackx
Copy link
Contributor Author

For anyone who wasn't following along, #37990 became embroiled in an impossible conflict of "we can't have this because it adds some ugly API that we should remove later but we can't remove API fields from a non-WIP API" and "it can't work without either the ugly API or a huge risky core change to envoy". The agreed compromise was to make it a new filter, still tagged WIP, so the ugly API can be removed if the roadblocks are ever addressed.

The old cache filter at this point has no maintainer sponsor (though I'm still on there for now), meaning it will eventually need to move into contrib or be removed entirely.

@adisuissa adisuissa assigned yanavlasov and unassigned adisuissa Sep 21, 2025
@ravenblackx
Copy link
Contributor Author

/coverage

Copy link

Coverage for this Pull Request will be rendered here:

https://storage.googleapis.com/envoy-cncf-pr/41148/coverage/index.html

For comparison, current coverage on main branch is here:

https://storage.googleapis.com/envoy-cncf-postsubmit/main/coverage/index.html

The coverage results are (re-)rendered each time the CI Envoy/Checks (coverage) job completes.

🐱

Caused by: a #41148 (comment) was created by @ravenblackx.

see: more, trace.

@ravenblackx
Copy link
Contributor Author

/retest

@yanavlasov
Copy link
Contributor

The original #37990 was reviwed by @toddmgreer . I'll do a second pass .

Copy link
Member

@agrawroh agrawroh left a comment

Choose a reason for hiding this comment

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

LGTM for deps

@agrawroh agrawroh removed the deps Approval required for changes to Envoy's external dependencies label Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants