It still stunning huge. I don't know is it me or is it Badgen, but mostly always nothing works. Neither F5, neither another browser, neither visiting the page in npm, neither Ctrl+R. I'm not sure if it's the caching for chrome too (i aggressively use much chrome flags). But still, it seems that that's not the problem, because even with another browser it does not refresh them.
I suggest to add a query param that always gives you fresh one, so i will be able to add it to my badge links.
Because currently i'm forced to visit the badge's link directly.
My guess is Now CDN is caching the response but this can be controlled by badgen by setting cache-control headers.
I don't think it's the Now, but yea maybe.
Here's the cache header for live badge:
cache-control: public, max-age=60, stale-while-revalidate=604800, stale-if-error=604800, s-maxage=360
cf-cache-status: MISS
And AFAIK, we may encounter these cache/latency for a live badge to refresh:
max-age=60, CTRL+R would bypass this;s-maxage=360, in seconds. (6 mins);npm v pkg has 1 minute delay or so for newly published version).Overall, a new version may have up to 10min (by my estimate) delay from publishing to shown on the badge.
Hi @tunnckoCore do you have any advice on this? If no further action we should take, I'm going to close this issue :D
@tunnckoCore I had an idea that we could add a ?cache=30 to limit the cache age on cdn, but make it 1 second at least internally, for perf's sake.
Make sense. But I currently am not sure if it still an issue. ;d
:D Then just hold this issue for a while. I'm kinda busy recently anyway. Let's revisit it later.
I think we should move out from unpkg. It recently implemented super aggressive cache strategy. And that definitely have an impact, I can't wait for hours (recently updated after 8+ hours), and still not guaranteed even after so many hours.
It's not actually _that_ critical problem. It's just frustrating that badges are showing old versions, when I visit the npm site it also sometimes does not showing latest (or no matter what) version (on the /versions tab) and etc. So, the only way to be sure everything is working is to look at the CI job for publishing to see if _actually everything is published correctly_ and refresh GitHub's Releases tab dozen times.
@tunnckoCore Just realized that, append any args to the badge url will give you a one-time no cache badge, like https://badgen.net/npm/v/express?092734
With this, you can easily verify if it's cached on badgen.net, or 3rd party api service.
Oh cool, I didn't think for that :D
So this can be closed 馃槈
Most helpful comment
@tunnckoCore Just realized that, append any args to the badge url will give you a one-time no cache badge, like
https://badgen.net/npm/v/express?092734With this, you can easily verify if it's cached on badgen.net, or 3rd party api service.