File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
packages/open-next/src/adapters Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " open-next " : patch
3
+ ---
4
+
5
+ server: hash message dedup id
Original file line number Diff line number Diff line change 1
1
import path from "node:path" ;
2
+ import crypto from "node:crypto" ;
2
3
import type {
3
4
APIGatewayProxyEventV2 ,
4
5
APIGatewayProxyEvent ,
@@ -271,10 +272,12 @@ async function revalidateIfRequired(
271
272
// your page will need to have a different etag to bypass the deduplication window.
272
273
// If data has the same etag during these 5 min dedup window, it will be deduplicated and not revalidated.
273
274
try {
275
+ const hash = ( str : string ) => crypto . createHash ( 'md5' ) . update ( str ) . digest ( 'hex' )
276
+
274
277
await sqsClient . send (
275
278
new SendMessageCommand ( {
276
279
QueueUrl : REVALIDATION_QUEUE_URL ,
277
- MessageDeduplicationId : `${ rawPath } -${ headers . etag } ` ,
280
+ MessageDeduplicationId : hash ( `${ rawPath } -${ headers . etag } ` ) ,
278
281
MessageBody : JSON . stringify ( { host, url : rawPath } ) ,
279
282
MessageGroupId : "revalidate" ,
280
283
} )
You can’t perform that action at this time.
0 commit comments