Skip to content

Commit

Permalink
fix: only cache fees response if exclusive (#1267)
Browse files Browse the repository at this point in the history
* feat: only cache fees response if exclusive

* fixup
  • Loading branch information
dohaki authored Nov 5, 2024
1 parent f62ad48 commit 74a687c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/suggested-fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,11 @@ const handler = async (
responseJson,
});

response.setHeader("Cache-Control", "s-maxage=10");
// Only cache response if exclusivity is not set. This prevents race conditions where
// cached exclusivity data is returned for multiple deposits.
if (exclusiveRelayer === sdk.constants.ZERO_ADDRESS) {
response.setHeader("Cache-Control", "s-maxage=10");
}
response.status(200).json(responseJson);
} catch (error) {
return handleErrorCondition("suggested-fees", response, logger, error);
Expand Down

0 comments on commit 74a687c

Please sign in to comment.