Take the 2-minute tour ×

My scenario:

  1. There's a blog that runs on Blogger, and that's also where it's hosted. Afaik, "external" (js) files cannot be hosted on Google's servers.
  2. When it comes to including popular JS frameworks (e.g., jQuery), there are several CDN options at our disposal.
  3. Looking for a jQuery-based Lightbox replacement for a blog, I've stumbled upon ColorBox; no plans to have a CDN for it though.

So far, when it comes to including/hosting the files under the given constraints, I've noticed the following suggestions/solutions:

  1. Including the minified version of the code inline in the Blogger template -- 9KB worth of JS code in a <script> element.
  2. Linking directly to the github raw version -- e.g., v1.3.16. (unreliable availability?)

Considering load speeds and availability what is the best practice for this scenario?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Based on what you describe, I don't see much benefit to not including the code in the Blogger template. It's arguably small enough that anyone not sucking their internet through a straw will not notice the increased time to download the page source, and it will certainly be faster overall than loading from a remote server, so it looks like the only likely performance hit is that you might have decreased responsiveness (time until the user can interact with the page), but it should only be noticeable if the user happens to have an especially narrow connection.

So, you'll have to consider your users, but unless an extraordinary number of them have narrow connections, just include the code inline.

share|improve this answer

Your Answer


