Me : Let's just use CDN.
Former boss (fb) : What's that?
Me : You fetch JS and CSS files online. Faster.
Fb: No! Download it!
Me: Why?
Fb: What if there's no internet?!
Me: ... it's a website...

  • 17
    I have to agree with your former boss. If the connection between you and the CDN is somehow interrupted, that's a problem. As far as speed, it's not faster to load across an internet connection vs a local file. Sorry to be an asshole. Just my opinion.
  • 12
    If I were your boss I'd tell you to have a fallback plan. I remember a two day outage of AWS a few years back. Many companies had no fallback and suffered the consequences. If you could cover that in your plans then, yeah, CDN is fine. Personally I get a little nervous relying heavily on servers not in my control. Admittedly things are be the today than a few years ago. As far as speed, I suppose if your users are closer to the CDN servers it makes sense. Especially for media files.
  • 4
    @edisonn I think what is being said is that you should cache JavaScript and CSS files on client machines as well as use a CDN.

    Even better, include a Service Worker to handle everything for those advanced/future users :D
  • 3
  • 3
    In theory, a cdn is faster and more scalable, but I've had several instances where a site wouldn't load because the cdn was down for a minute. At least with local, if the page loads, everything loads. Thats worth sacrificing a few fractions of a second.
  • 3
    it is me, living in third world, and me download the resources in case we lost internet connection. then move to cdn in deployment
  • 2
    Thanks for all the advice. He meant that if the user doesn't have internet. I know he could be right or use cache whatever, but trust me, what he had in mind, is facepalm worthy.
  • 1
    Cdn or not you download it anyway.

    Reminds me of an ex boss who wanted to protect mp3s on the website from being downloaded.

    I was like, as soon as that MP3 blasts through their speakers it has been downloaded. There is no way to have a 100% safe protection from a website..
  • 5
    @jlcfly the biggest reason for CDN is that it could already be cached in your browser, from another site.
  • 0
    @topfs Good point
  • 2
    I think the rant has gone out of context. It's not about whether to CDN or not. It's my former boss thinking how can people use CDN on the site when they don't have internet. My former boss is not even a dev, he is was a businessman who sits and gamble the whole day. He doesn't know jack shit about tech. It's a simple rant about the logic of his statement. Anyways, thanks for all the advices.
  • 2
    @eshwarenm oh he thought that a CDN allows offline access to the whole site? Haha, nice.

    Don't tell him about service workers or he'll make you use them everywhere :P
  • 2
    @NathanDoesDev nah he forgot the fact that people won't be able to get on websites if there is no internet.
  • 0
    @eshwarenm it is actually possible for websites to be accessed offline if everything is cached or if you use service workers (although those are still experimental)
  • 3
    @NathanDoesDev yes yes yes yes I know. But there's no way my former boss knows that. Yes very experimental and certainly requires users to visit the site first.
  • 0
    @eshwarenm ah, so he wants magic XD

    *sighs* now if only my clients would stop asking for magic projects as cheap and fast as possible :/
  • 0
    @Sauruz Some days ago, there was a major outage of Google in central Europe ^^ And +1 for the people who already had trouble because a CDN was down in the past :)
  • 1
    The CDN can go down independently of your website, and I could understand a non tech person describing that as "what if there is no internet"
Add Comment