Comments (7)
Definitely interested in this.
One of the issue with lambda response streaming as of now is that it only support lambda function url.
I've started playing with it yesterday to see if it would be difficult to support and it should not be to difficult, but we need to figure out how to support both edge and standard lambda : conico974@688150d
from open-next.
@conico974 were you able to cache the streamed data? I tried playing w/ streaming in server-adapter but the content type ended up being an octet-stream
from open-next.
Yes it was kind of working, i hacked something here : https://github.com/conico974/open-next/blob/688150d0a09d78a12f0ba926097c8282b6ec2745/packages/open-next/src/adapters/response.ts#L85 to set the content type.
This was the only way i found to set the headers on the response stream, but i haven't looked too much into this.
There is also a setContentType
method on the responseStream
object but we need to call this before writing anything to the stream, otherwise it will log an error and set the content type to octet-stream
from open-next.
@conico974 I've forked your commit and investigating further. Found this function sets content type after the stream has already been written to.
https://gist.github.com/magJ/63bac8198469b6a25d5697ad490d31e6#file-index-mjs-L806
from open-next.
@DavidHooper Nice catch looking at the runtime.
This function is actually called from user code, so it's likely something i have done or that you've done.
Looking at the gist, the response stream provided to us is actually https://gist.github.com/magJ/63bac8198469b6a25d5697ad490d31e6#file-index-mjs-L197.
We should probably rewrite the response class from open-next around that class
from open-next.
Is there any update on this? I would love to see it implemented!
from open-next.
@passgoco https://discord.com/channels/983865673656705025/1027265626085019769/1149742408565800990
Still experimental, chunks aren't compressed, we're looking into rewriting the http server. Help us if you can.
from open-next.
Related Issues (20)
- next/image `url` param is incorrect when using `basePath` HOT 2
- Next Cache never expires with Pages Router HOT 4
- open-next errors out on some favicon formats. HOT 5
- [Edge] CloudFront Blacklisted headers Server Actions HOT 1
- Inconsistent `cache-control` for remote Next Images on Cloudfront HOT 1
- [Streaming] Lambda Timeout when using React Suspense HOT 5
- Leading slash redirects not working for next server actions (but does work locally) HOT 5
- ENOENT: no such file or directory, scandir '.open-next/...' HOT 18
- Nextjs doesn't have "copyFiles" property HOT 2
- Next.js redirects in config broken in rc15 HOT 5
- Hitting a non-existent route results in infinite redirect. Same app behaves correctly locally and on vercel. HOT 4
- Image optimization fails due to version mismatch HOT 15
- [BUG] Could not resolve `@aws-sdk/client-sso-oidc` HOT 3
- Unable to Deploy Serverless with API Gateway HOT 4
- [BUG] Error on Warmer function HOT 3
- Lambda@Edge tried to add, delete, or change a read-only header HOT 2
- Undefined environment variables after upgrade to V3 HOT 4
- getting started ion link redirecting to wrong page HOT 1
- (Next)Auth doesn't properly refresh the page when deployed using Open Next HOT 7
- Redirect to different domain result in invalid url HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-next.