Skip to content

http: add server factory only factory support to cache#46218

Open
wbpcode wants to merge 1 commit into
envoyproxy:mainfrom
wbpcode:route-factory-cache
Open

http: add server factory only factory support to cache#46218
wbpcode wants to merge 1 commit into
envoyproxy:mainfrom
wbpcode:route-factory-cache

Conversation

@wbpcode

@wbpcode wbpcode commented Jul 17, 2026

Copy link
Copy Markdown
Member

Commit Message: http: add server factory only factory support to cache
Additional Description:
This adds the server-factory-context-only filter factory creation method
(createHttpFilterFactoryFromProtoTyped taking only a ServerFactoryContext,
introduced in #45989) to the cache HTTP filter(s).

This allows these filters to be created in contexts where only a
ServerFactoryContext is available (e.g. route/virtual-host level filter
configuration) rather than requiring the full downstream FactoryContext.
The existing downstream FactoryContext path is preserved and now delegates
to a shared helper, so behavior for existing use cases is unchanged.

Generative AI was used to assist with this change. I have reviewed all changes.
Risk Level: Low
Testing: Existing/added unit config tests; CI.
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #46218 was opened by wbpcode.

see: more, trace.

Signed-off-by: wbpcode <wbphub@gmail.com>
@wbpcode
wbpcode force-pushed the route-factory-cache branch from ca5f5bd to 0bc1a49 Compare July 18, 2026 09:16
@wbpcode
wbpcode marked this pull request as ready for review July 18, 2026 09:16
@wbpcode
wbpcode requested a review from ggreenway as a code owner July 18, 2026 09:16
Comment on lines 322 to +323
getCache(const envoy::extensions::filters::http::cache::v3::CacheConfig& config,
Server::Configuration::FactoryContext& context) PURE;
Server::Configuration::ServerFactoryContext& context) PURE;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This also may break forks but it's should be fine because:

  • Cache still in WIP status.
  • All existing getCache implementation will return a singleton which will be shared across listeners, it would be better to use server factory context here.

@wbpcode

wbpcode commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

I actually don't know if this necessary after we had cache v2. But this change is simple and almost similar with cache v2. So, I still create a PR.

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