Open azhong-git opened 2 years ago
No longer a blocking issue for me and it seems that the behavior is expected according to CloudFront docs included in the clarification of issue 1 above.
However I am still looking for advice on best practice updating static files:
I just came looking for this exact issue. I think the 10 minute times you are experiencing could be considered lucky as we are seeing anything from 10 minutes to a few days for everything to clear out depending on how cloudfront handles things.
I have not tried this yet but you may just be able to set invalidationPaths: ["/*"]
as per the docs or define this manually.
Issue Summary
Hello, I am using the following script to deploy a NextJS site to CloudFront. However I came across the following two issues regarding statically served files under
/public
:Blocking despite updating a file (without changing filename) in/public
, the file in the deployed site does not get updated while local dev or deploy test works. In my case, I was updatingpublic/favicon/favicon.ico
.Not blocking but not ideal: a newly added file is not accessible until 10 minutes later after the
npm run cdk deploy
finishes.Is any of the two issues expected? I have included my script (pretty standard) below:
Expected behavior
Local changes in
/public
gets updated in the deployed site right away afternpm run cdk deploy
.Versions
"@sls-next/cdk-construct": "^3.7.0", "@sls-next/lambda-at-edge": "^3.7.0",
Checklist
latest
oralpha
@sls-next/serverless-component
release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the oldserverless-next.js
component and theserverless-next.js
plugin are deprecated and no longer maintained.