Open djanogly opened 1 year ago
Hi @djanogly, there is a variant setup where the middleware can run inside a Lambda instead of at the end. So if there isn't a Lambda@Edge equivalent service in GCP, this could work.
The downside with this setup is that, if a page uses middleware, it cannot be served from the cache (even if it's a static page). The page has to be server rendered in order for middleware to run.
This is possible now (since the V3 release), it would require a bit of work though.
You'll need to create a custom wrapper, converter, incremental cache, queue, tag cache and image loader (the wrapper and converter is probably not needed for cloud run) https://opennext.js.org/aws/config/custom_overrides.
The easiest would be for someone to create a lib to automatically do all of this in the open-next.config.ts
I'll keep this open if someone want to try to tackle this
Hey, awesome project
Do you currently have any plan to support GCP? I find AWS's Lambda functions quite restrictive (size, runtime limits) compared to GCP's Cloud Functions / Cloud Run
I'm not sure what service could be used for the middleware, as I don't think GCP have a Lambda@Edge equivalent
Cheers