You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 28, 2025. It is now read-only.
Describe the bug
JSON data files for SSG pages (e.g. `_next/data/{build id}/file.json) are not being cached by Cloudfront, meaning that subsequent calls always go to the origin (and trigger the Lambdas@Edge).
To Reproduce
Deploy a website with at least one SSG page.
Visit the SSG page once. This should cache the JSON data.
Refresh that page and observe the x-cache response header set to Miss from cloudfront
Expected behavior
On step 3 above, we should observe Hit from cloudfront
Additional context
During the upload of these files, no Cache Control is set, which I suspect is the underlying cause. There should be no concern about caching these for a long time, since the build ID is in the path and SSG data should not vary within a single build.