Partial Prerendering with AWS Cloudfront Cache
Unanswered
Scottish Fold posted this in #help-forum
Scottish FoldOP
Hi, I've sat up a simple NextJS application to test out if its possible to do partial prerendering with a AWS cloudfront CDN.
I'm running:
* NextJs 15.0.0-canary.178 - App router
* Standalone configuration
* Docker build and Kubernetes
* The request flow is client => Cloudfront => Server
* Note that I'm using Server Side Rendering to fetch data on the server
So given a page.tsx that has a Suspense component I want to cache the shell around in cloudfront but still allow for streaming of the content with PPR. When I set up the caching on cloudfront the html after the streaming has ended is then cached instead of the shell. This is ofc not something I want to have since the Suspended content could be user data. Is it even possible to cache only the html shell with SSR and stream in the content with PPR and Cloudfront?
I'm running:
* NextJs 15.0.0-canary.178 - App router
* Standalone configuration
* Docker build and Kubernetes
* The request flow is client => Cloudfront => Server
* Note that I'm using Server Side Rendering to fetch data on the server
So given a page.tsx that has a Suspense component I want to cache the shell around in cloudfront but still allow for streaming of the content with PPR. When I set up the caching on cloudfront the html after the streaming has ended is then cached instead of the shell. This is ofc not something I want to have since the Suspended content could be user data. Is it even possible to cache only the html shell with SSR and stream in the content with PPR and Cloudfront?