# nftstorage.link ๐๐
## everywhere ๐
# all the time ๐ฏ
---
# Problem โ

Let's limit the blast radius of the red screen'o'death
---
# Solution ๐งช
---
Intercept requests with a ๐<code class="blue">service worker </code>

---
# Faster โฑ
_Cache everything_
# Robust-er ๐ช
_Fallback to dweb.link on error_
---
### Dreamcode โจ๐ท๐ฉ
```htmlmixed=
<title>NFT Marketplace</title>
<script>
navigator.serviceWorker.register('nftstorage-sw.js')
</script>
<img src="/ipfs/bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy" />
```
---
# Simple!
_How hard can it be, right?_
---
# ๐ Debugging ๐ฑ
## <code class="blue">service workers ๐</code>
---
# โ
Testing ๐ฑ
## <code class="blue">service workers ๐</code>
---
# [IT LIVES](http://localhost:3000)
---
# โ
Testing ๐ฑ
## <code class="blue">service workers ๐</code>
---
# new hotness โค๏ธโ๐ฅ

---
# ๐ญ cant mock
## <code class="blue">service workers ๐</code>
# with
## <code class="blue">service workers ๐</code>
---
# ๐
# <code class="blue">playwright-test</code>
---
## ๐ญ the first run problem

---
```text
> YO DAWG!
>
> IT HAS COME TO MY ATTENTION THAT YOU ARE FOND OF GATEWAYS.
>
> AS SUCH, I HAVE PUT A GATEWAY IN FRONT OF YOUR GATEWAY.
```

---
## [`link.web3.storage`](https:///link.web3.storage/ipfs/bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy)
The bouncer ๐
[_making jchris' dreams come true_](https://github.com/nftstorage/nft.storage/issues/1435)
---
## it bounce!
- ipfs:// - [https://link.web3.storage/ipfs://bafkre](https://link.web3.storage/ipfs://bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy)
- IPFS paths - [https://link.web3.storage/ipfs/baf](https://link.web3.storage/ipfs/bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy)
- IPFS gateway urls
- anything else pass thru
---
## Let's go deeper
_What if it was a ๐ this whole time..._

---
<code class="blue">service worker ๐</code>
### fetch the CID as a ๐ and verify ๐ง
[](https://service-worker-car.vercel.app/)
---
## Open questions
- What if user link to the wikipedia root cid?
- dir listing?
- naming `nftstorage-sw` & `link.web3.storage`
- how best to publish service-workers
---
# GO!
# TEAM!
# ๐ โ
<style>
.blue {
color: #337AB7 !important;
}
.orange {
color: #F7A004 !important;
}
</style>
{"metaMigratedAt":"2023-06-17T00:23:13.902Z","metaMigratedFrom":"YAML","title":"nftstorage.link everywhere all the time","breaks":true,"description":"View the slide with \"Slide Mode\".","contributors":"[{\"id\":\"10fd76b5-9fc4-4ccc-b4d5-b6dfc2f19760\",\"add\":5290,\"del\":2641},{\"id\":\"afc5a5b3-c538-4984-bc39-4fb544f79eaf\",\"add\":180,\"del\":11}]"}