-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: quick TTFB & TTI for large content #138
feat: quick TTFB & TTI for large content #138
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #138 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 35 35
Branches 5 5
=========================================
Hits 35 35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review
changes deployed on https://bafybeidsp6fva53dexzjycntiucts57ftecajcn5omzfgjx57pqfy3kwbq.ipfs.sw.sgtpooki.com/ use https://support.mozilla.org/en-US/kb/clear-cookies-and-site-data-firefox to clear data on firefox. TTFB on firefox from sw.sgtpooki.com is ~14000ms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Barring a bunch of nits this is great!
Summary of changes (for me):
- Handle aborts from original fetch event
- Don't await Cache API puts (TIL)
- Respect cache-control: no-cache
(Don't cache 206s was already there but new to my eyes)
Co-authored-by: Daniel Norman <1992255+2color@users.noreply.github.com>
Title
feat: quick TTFB & TTI for large content
Description
This updates helia-service-worker-gateway to @helia/verified-fetch@1.3.0 and ensures we're respecting the request event's AbortSignal.
Summary of changes (thanks @2color):
Notes & open questions
after getting #122 and ipfs/helia-verified-fetch#26 merged.. then updating @helia/verified-fetch in service-worker-gateway locally…. large video loading feels much more responsive
For the below, I hardcoded my local kubo node to ensure trustless-gateway.link was not being used.
big-buck-bunny TTFB/TTI for the code in this PR from kubo node with content:
Brave: consistently < 800ms
FireFox: 159ms
npx kubo daemon
You can use the below process and code snippet to get TTFB:
big-buck-bunny TTFB/TTI for code in this PR pulling from fresh kubo node:
Brave: 4-12s.
see #131 (comment)
big-buck-bunny TTFB/TTI for
main
branch code on kubo node with contentIn Brave: Consistently over 1000ms.. with a fresh service worker
In Firefox: idk why but it was returning within a few ms.. old cache/sw that wouldn't go away? https://support.mozilla.org/en-US/kb/clear-cookies-and-site-data-firefox didn't always take
big-buck-bunny TTFB/TTI for code in
main
from fresh kubo node:Brave: averaging ~70-90 seconds
Change checklist