This repository was archived by the owner on Jan 28, 2025. It is now read-only.
ISR not working when revalidate is less than the SQS 5-minute deduplication interval #2483
Open
3 tasks done
Issue Summary
Changes to my ISR page take up to 5 minutes to update after the underlying data is changed.
Actual behavior
Let's say I have a user profile page which features a user's user name. This is a ISR powered page with
revalidate
option set to1
.delisdeli
newname
with a SQL querydelisdeli
delisdeli
<= I would have expected to seenewname
nownewname
Expected behavior
delisdeli
newname
with a SQL querydelisdeli
newname
Steps to reproduce
See above.
Screenshots/Code/Configuration/Logs
Can add later if needed.
Versions
Additional context
I believe the issue is due to SQS deduplication ID being set to the page ETag. Because the ETag will be that of the cached page in S3 and the deduplication ID is the same then SQS will ignore the regeneration messages (even after events are deleted from the queue) due to how SQS deduplication logic works (docs). I have tested setting deduplication id to current time in seconds and the behavior is as expected. Happy to open a PR if this is the right approach.
Code links that show deduplication ID is set to ETag:
serverless-next.js/packages/libs/lambda-at-edge/src/default-handler.ts
Line 388 in e6367b5
serverless-next.js/packages/libs/lambda-at-edge/src/lib/triggerStaticRegeneration.ts
Line 60 in e6367b5
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.The text was updated successfully, but these errors were encountered: