Home > Mobile >  Difference in JSDelivr URL with & without "latest"
Difference in JSDelivr URL with & without "latest"

Time:09-17

I went to GitHub issues to raise a support ticket but thought of asking the question first to avoid noise.

This is what the enter image description here enter image description here Result 12:41:00 UTC Points to latest release 0.0.3 Points to latest release 0.0.3 Publish new NPM release 0.0.4 12:48:00 UTC Refresh both the URLs 12:49:00 UTC Shows old release 0.0.3 Shows latest release 0.0.4

The last step shows that I was wrong here. This is working as expected (i.e. showing 0.0.3 only) as per the docs

CodePudding user response:

The caching time is the same in both cases - 12 hours at the CDN level and 7 days in the browser: cache-control: public, max-age=604800, s-maxage=43200

That doesn't necessarily mean both URLs will always return the same content because both the CDN and your browser calculate the expiration for each URL independently, based on when it was first retrieved, so the CDN may serve different versions for up to 12 hours after the release.

CodePudding user response:

Seems to me both the links point to the same sdk URL. As per how cdns work would be to mention the version of the sdk for example:

<script src="https://unpkg.com/[email protected]/examples/js/loaders/GLTFLoader.js"></script>

or as per below which will always point to the latest version of the sdk:

<script src="https://cdn.rawgit.com/mrdoob/three.js/master/examples/js/loaders/GLTFLoader.js"></script>
  • Related