I load various libraries like tailwinds or v-calendar from unpkg.com and recently learned an important lesson regarding this I thought was worth sharing…
I have a BetterForms site that would occasionally seem to not load at all. Often if I refreshed the page, it would load as expected. It was an intermittent issue, so it took a while to pinpoint. Eventually, I noticed that resources from unpkg.com could take 10 seconds or more to load and they would block the page while loading. If you read about their Cache Behavior, you’ll see that if you don’t specify a specific version by number, then it will redirect to one and the redirect is only cached for 10 minutes by the CDN and 1 minute by the browser. In contrast, a specific version is cached by the browser for a year. So I was able to resolve this issue by changing this:
The down-side is that I now have to manually update this url to get the latest bug fixes. I subscribed to github release notifications for all libraries I made this change to, so I would at least know when new versions came out and could know to change the url in my BetterForms site, if I thought I needed the new version.