# nftstorage.link ๐ŸŽŸ๐Ÿ”— ## everywhere ๐ŸŒ # all the time ๐Ÿ’ฏ --- # Problem โŒ ![](https://i.imgur.com/ZCaVEaO.png) Let's limit the blast radius of the red screen'o'death --- # Solution ๐Ÿงช --- Intercept requests with a ๐Ÿ”€<code class="blue">service worker </code> ![](https://i.imgur.com/DCWVY3T.jpg) --- # 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 โค๏ธโ€๐Ÿ”ฅ ![](https://i.imgur.com/rZqJtvM.png) --- # ๐Ÿ˜ญ 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 ![](https://i.imgur.com/63z7sxX.png) --- ```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. ``` ![](https://i.imgur.com/mg3ga3e.jpg) --- ## [`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..._ ![inception car](https://preview.redd.it/5wy5bm4o5dy41.jpg?width=960&crop=smart&auto=webp&s=5969875995b1bd7f9a8d63b46947c501b2dd7ec7) --- <code class="blue">service worker ๐Ÿ”€</code> ### fetch the CID as a ๐Ÿš— and verify ๐Ÿง [![](https://i.imgur.com/lUVlhDY.png)](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}]"}
    430 views