Skip to content

Add experimental HTTP filter world - #973

Open
yoshuawuyts wants to merge 1 commit into
yoshuawuyts-wit-dependency-bootstrapfrom
yoshuawuyts-http-filter-world
Open

yoshuawuyts wants to merge 1 commit into
yoshuawuyts-wit-dependency-bootstrapfrom
yoshuawuyts-http-filter-world

Conversation

@yoshuawuyts

Copy link
Copy Markdown
Member

Hey all, this adds an experimental new world wasi:http/filter and interface filter-handler which are optimized for resource-constrained environments. Unlike wasi:http/middleware, filter splits handling the request and handling the response so it can be done by two separate component instances. Depending on the use case can save a fair bit on memory.

This interface is however not without its tradeoffs: wasi:http/middleware will always be more flexible and easier to compose. But at least at Microsoft we’re working with systems for which the middleware world still has too much overhead, and so I’d like to propose a minor extension that is mostly compatible with middleware, but carries less overhead.

In terms of implementation: this API should be entirely shimmable on top of wasi:http/middleware. The additional cost for existing runtimes to support this should be minimal. Thanks!

@yoshuawuyts
yoshuawuyts requested review from a team as code owners December 4, 2026 20:20
@yoshuawuyts

Copy link
Copy Markdown
Member Author

It seems CI on main is failing, causing CI for this PR to fail. Probably because of #972 which we merged earlier. Investigating how to fix that.

@yoshuawuyts
yoshuawuyts force-pushed the yoshuawuyts-http-filter-world branch from a5e8cec to 6dcf957 Compare December 4, 2026 21:37
@yoshuawuyts
yoshuawuyts changed the base branch from main to yoshuawuyts-wit-dependency-bootstrap December 4, 2026 21:49
@yoshuawuyts
yoshuawuyts added this pull request to stack #975 December 4, 2026 21:49
Signed-off-by: Yosh <github@yosh.is>
@yoshuawuyts
yoshuawuyts force-pushed the yoshuawuyts-http-filter-world branch from 6dcf957 to d299019 Compare December 4, 2026 21:53
@sunfishcode

Copy link
Copy Markdown
Member

In addition to resource-constrained environments, this can also allow simple applications to reach greater scalability, so +1 from me.

@sw17ch sw17ch left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This seems reasonable to me.


/// This is the default `client` to use when user code simply wants to make an
/// HTTP request (e.g., via `fetch()`).
import client;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Edge Actions currently does not support guest-initiated outbound HTTP. Is client intended to be optional once Component Model optional imports land? For the initial version, can we explicitly document that hosts may deny all client.send calls with HTTP-request-denied if they don't support outbound requests?

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.

4 participants