I went to GitHub issues to raise a support ticket but thought of asking the question first to avoid noise.
This is what the docs says-
Omit the version completely or use "latest" to load the latest one (not recommended for production usage):
/npm/jquery@latest/dist/jquery.min.js /npm/jquery/dist/jquery.min.js
According to the doc, either we can latest
or omit it completely to load the latest version. But I'm seeing a difference-
latest
added (URL 1 - U1)Example- https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@latest/dist/sdk.min.js
It loads the last released version that is cached for 24 hours. That means if we release v2 & v3 within 24 hours, the above URL will still show v1.
The caching period is 1 week.
latest
(URL 2 - U2)Example- https://cdn.jsdelivr.net/npm/@letscooee/web-sdk/dist/sdk.min.js
While we omit the latest
completely, this loads the latest release immediately i.e. v3 and the caching period is also 1 week.
I have requested for the purge API as per their docs but I believe this behaviour is not aligning with their docs.
Tried to Google the cause and read their docs 3 times. Am I missing something?
After reading Martin's answer, I did the following-
(To view the images, open them in new tab & remove t
before .png
)
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
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.