Skip to content

Comment on Show HN: Supershields.io – smart, Lua-powered SVG status badges

Comments

Something I've always wondered about these shields... How do you ensure the platforms where users embed them don't cache the images in their CDNs?

Is it just a matter of setting headers?

rlonnOP

If you load http://example.com and the HTML there includes an image tag that says '<img src="http://othersite.com/image.jpg">' it means your browser will connect to othersite.com and ask that site for the image. It will not ask example.com.

I'm asking about what happens when, for example, you embed a dynamic SVG badge in your GitHub readme.

Doesn't GitHub cache every image in their own CDN for security and control purposes?

rlonnOP

You can't use <object>, <iframe> etc tags to embed pictures in your Github README, so you don't get automatic updates there no matter what (i.e. images would only refresh on page load). I don't know if Github proxies and caches <img> contents, or how long they cache it for but I haven't personally seen any delays when I've updated images used in READMEs.

But to repeat: auto-updating will not work for Github-hosted content AFAIK.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.