-
Notifications
You must be signed in to change notification settings - Fork 799
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
Move from Google Cloud Storage API URLs to Google Cloud CDN #1849
Comments
I think, using open source public cdn service rather using "official" google cdn might be a better solution. Currently I am maintaining workbox-cdn@npm with nuxt-community, so that we can load workbox lib from unpkg and jsDelivr. It would be better if workbox team could officially maintain a pre-built runtime libraries repository at GitHub or NPM. |
So I think the main thing that prevented us from using, i.e., unpkg initially was the fact that what we publish to If there's a way to get a third-party CDN to serve our pre-built modules (which are effectively IIFEs, in the format that can be loaded via |
(I don't know how things work at Google but...) Maybe you guys can host workbox on I think this will be much simple to maintain because you'll won't have to worry about having a domain, managing DNS, managing a custom SSL certificate (because Google-managed SSL certificates are not covered by any SLA yet) etc. |
Yup, we are exploring our options, including the precedent set by other public SDKs hosted by Google. One of the other considerations is that we need to have a good amount of control over when the CDN copy of a given release goes live, so that we could coordinate that with Publishing directly to Google Cloud Storage gives us a lot of control over that at the moment. |
Although infrastructure managed by Google or workbox team, such as I suggest remaining managed infrastructure as default config in workbox lib to ensure every single pre-built module is available, but allow developer to choose serve from custom server or third-party CDN (leave developers to check if current version of workbox is reachable on third-party CDN, like jsDelivr or unpkg), just as workbox currently doing. |
Agreed. Google Cloud Storage is a not-so-great CDN solution. To be honest I had to do this workaround below to avoid its issues (because most corporate/educational firewalls block
Being able to use a proper CDN (like jsDelivr or even |
I'd encourage folks to import Workbox from a first-party URL if you're concerned about the CDN not being available for a percentage of your target audience. Based on that code sample above, if you're going to the trouble of hosting a copy of the Workbox libraries locally already, you might as well prefer that copy over the CDN copy. I think longer-term, the direction we see folks going is to create their own custom bundles that contain their service worker logic along with along the exact Workbox code that they need, via the approaches outlined in https://developers.google.com/web/tools/workbox/guides/using-bundlers We do still plan on offering a CDN solution, and we do plan on moving off of |
Given that the focus in v5 is on modes in which you produce your own local bundles, I now think it's not worth the effort to move off of the Google Cloud Storage API. |
Right now, we upload copies of the pre-built Workbox runtime libraries to Google Cloud Storage, and advertise URLs like http://storage.googleapis.com/workbox-cdn/releases/4.0.0-beta.1/workbox-sw.js as the "official" CDN.
Each requests against that sort of URL ends up hitting the Google Storage API, though, which incurs a bit of extra latency and cost.
We should look into using something like https://cloud.google.com/cdn/ in front of those Google Storage API URLs, and switch over the "official" CDN URL as needed for future versions (while still keeping the old URLs around).
The text was updated successfully, but these errors were encountered: