From c5c4775cec537773276fd5bb1b8b724d63adaa5f Mon Sep 17 00:00:00 2001 From: ameanasad Date: Tue, 19 Dec 2023 11:39:02 -0500 Subject: [PATCH] feat: update saturn client v0.3.7 --- package.json | 2 +- src/sw/interceptor.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 90bf078..a7c8079 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "webpack-dev-server": "^4.7.4" }, "dependencies": { - "@filecoin-saturn/js-client": "^0.3.6", + "@filecoin-saturn/js-client": "^0.3.7", "@sentry/browser": "^7.69.0", "browser-readablestream-to-it": "^1.0.3", "debug": "^4.3.3", diff --git a/src/sw/interceptor.js b/src/sw/interceptor.js index 06dbf65..4ffbb7e 100644 --- a/src/sw/interceptor.js +++ b/src/sw/interceptor.js @@ -34,9 +34,14 @@ export class Interceptor { async start(controller) { try { const opts = { - customerFallbackURL: self.event.request.url + customerFallbackURL: self.event.request.url, + raceNodes: true, + firstHitDNS: true } - const contentItr = await self.saturn.fetchContentWithFallback(self.cidPath, opts) + const contentItr = await self.saturn.fetchContentWithFallback( + self.cidPath, + opts + ) await self._streamContent(contentItr, controller) } catch (err) { self._debug('Error', err)