Hacker News new | ask | show | jobs
by antsar 1569 days ago
Why waste bandwidth requesting the same file? I guess you could cache it “indefinitely”, but that’s functionally the same as just hosting it..
1 comments

For the same reason you chose to use a CDN instead of self-hosting in the first place. It takes away a lot of the complexity.

I'm not proxy'ing and HTTP caching typefaces but I used to URL-import JavaScript packages from a CDN. Availability as well as response latency at times were abysmal. I didn't want to give up on the comfort though. Now I'm just routing and HTTP caching requests to cdn.my-website.com to cdn.that-popular-provider.com

Availability is tied to the my-website.com's availability - which is great. And response latency went way down. And I didn't have to compromise on just dropping arbitrary JavaScript with arbitrary dependencies on the server without going through all the node and npm hassle first.

It's awesome.