Skip to content

Comments

feat!: s3-ddb cache handler replaces efs, run next build on host, use nextjs official adapter#187

Open
bestickley wants to merge 74 commits intomainfrom
feat-custom-cache-handler-s3-ddb
Open

feat!: s3-ddb cache handler replaces efs, run next build on host, use nextjs official adapter#187
bestickley wants to merge 74 commits intomainfrom
feat-custom-cache-handler-s3-ddb

Conversation

@bestickley
Copy link
Contributor

@bestickley bestickley commented Jan 12, 2026

Fixes #165, #142, #127, #121, #115

This PR will be released as 0.5.0-beta.1. It will remain beta until next.config.js' experimental.adapterPath is no longer experimental. This PR requires at least Next.js v16.1.1-canary.19 as it relies on Image Custom Cache Handler. While it's not ideal to depend upon experimental or canary features, this aligns with cdk-nextjs' design philosophy of not tampering with Next.js internals and relying on public APIs wherever possible.

  • Use S3 + DynamoDB as Next.js Cache replacing EFS
    • Create NextjsCache
    • Remove NextjsAssetDeployment
    • Fix APP_PAGE cahe kind with ⨯ Error: failed to pipe response error by storing as utf8 instead of base64
    • .next/cdk-nextjs-init-cache - fill with fetch and prerender json values
  • Run next build on host machine, not in container - simplifying build process and reducing build time.
    • buildContext is replaced with buildDirectory
    • Replace sharp with linux musl libvips since host machine is likely diff arch and platform then cloud/runtime
  • Use Next.js Official Adapters to simplify next.config.ts management.
  • NextjsRegionalFunctions now supports streaming (since API GW now supports it)
  • Improve docs by writing caching, pruning, and nextjs build output guide
  • Upgrade examples to Next.js 16
  • Upgrade Node.js to 24 (LTS)
  • Ensure e2e tests passing
  • Explore usage of S3 Directory Buckets (One Zone Express) for lower cost and faster response times for cache bucket. Decided not to use it. See S3 Directory Bucket (One Zone Express) vs Standard Buckets #191

Follow up Work

bestickley and others added 29 commits January 9, 2026 12:32
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@mergify
Copy link

mergify bot commented Jan 21, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

@mergify
Copy link

mergify bot commented Jan 23, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@mergify
Copy link

mergify bot commented Jan 23, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

@mergify
Copy link

mergify bot commented Jan 23, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

@mergify
Copy link

mergify bot commented Jan 23, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

@mergify
Copy link

mergify bot commented Jan 23, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@mergify
Copy link

mergify bot commented Jan 23, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

@mergify
Copy link

mergify bot commented Jan 23, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@mergify
Copy link

mergify bot commented Jan 23, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

@mergify
Copy link

mergify bot commented Jan 24, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@mergify
Copy link

mergify bot commented Jan 24, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

@mergify
Copy link

mergify bot commented Jan 24, 2026

❌ The current Mergify configuration is invalid

Details
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → strict
  • Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → merge → commit_message → title+body

@LaurenceGA
Copy link
Contributor

Hey. Just wondering what's the next step on this PR?

@bestickley
Copy link
Contributor Author

Hey Laurence, I've kinda been waiting for Next.js to release 16.2 so canary isn't required for image custom cache handler but it's taken a lot longer for them than I expected :/

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.

NextjsGlobalFunctions server actions fail when next build --turbopack

3 participants