MozillaReality / unity-webxr-export

INACTIVE - Assets for creating WebXR-enabled Unity3D projects.
https://mixedreality.mozilla.org/unity-webxr-export/Build/
Apache License 2.0
626 stars 127 forks source link

Add cache capabilities to the SW #98

Open delapuente opened 6 years ago

cvan commented 6 years ago

Thanks for filing this. Which caching strategy did you have in mind? Are you thinking of precaching everything or cache+network -> update or network -> cache?

I'm leaning toward stale-while-revalidate.

You're a Service Worker pro, so I'll defer this to you. If you want to write

I had a branch of using workbox (just checking in the files in a vendor/ directory, instead of requiring npm + Node, etc.).

I've been wondering if there's some way we can get Unity to calculate a hash of the file contents and bump the cache key in the Service Worker file (sw.js). In the past, I've written simple Node scripts to do this when I've written Service Workers manually (without workbox and its predecessors).

Let me know your thoughts.