How to link files directly from Github (raw.github.com)

The great service RawGit was already mentioned, but I’ll throw another into the ring: GitCDN.link Benefits: Lets you link to specific commits, as well as auto-get the latest (aka master) Incurs no damage from high traffic volumes; RawGit asks that it’s dev.rawgit.com links be only used during development, where as GitCDN give you access to … Read more

Font Awesome icons not showing in Chrome, a MaxCDN related Cross-Origin Resource Sharing policy issue

Here is the working method to allow access from all domains for webfonts: # Allow access from all domains for webfonts. # Alternatively you could only whitelist your # subdomains like “subdomain.example.com”. <IfModule mod_headers.c> <FilesMatch “\.(ttf|ttc|otf|eot|woff|font.css|css)$”> Header set Access-Control-Allow-Origin “*” </FilesMatch> </IfModule>

Why use protocol-relative URLs at all?

As of December 2014, Paul Irish’s blog on protocol-relative URLs says: 2014.12.17: Now that SSL is encouraged for everyone and doesn’t have performance concerns, this technique is now an anti-pattern. If the asset you need is available on SSL, then always use the https:// asset. Unless you have specific performance concerns (such as the slow … Read more

Purpose of installing Twitter Bootstrap through npm?

If you NPM those modules you can serve them using static redirect. First install the packages: npm install jquery npm install bootstrap Then on the server.js: var express = require(‘express’); var app = express(); // prepare server app.use(‘/api’, api); // redirect API calls app.use(“https://stackoverflow.com/”, express.static(__dirname + ‘/www’)); // redirect root app.use(‘/js’, express.static(__dirname + ‘/node_modules/bootstrap/dist/js’)); // … Read more

Microsoft CDN for jQuery or Google CDN? [closed]

Update based on comments: Short version: It doesn’t matter much, but it may depend on what they host. They all host different things: Google doesn’t host jQuery.Validate, Microsoft did not host jQuery-UI, since 2016 they do!!, Microsoft offers their scripts that would otherwise be served via ScriptResource.axd and an easier integration (e.g. ScriptManager with ASP.Net … Read more

Benefits vs. Pitfalls of hosting jQuery locally [closed]

I always use the CDN (Content Delivery Network) from Google. But just in case it’s offline: <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js”></script> <script>!window.jQuery && document.write(‘<script src=”jquery-1.4.2.min.js”><\/script>’)</script> Grab Google CDN’s jQuery and fallback to local if necessary Edit: If you don’t need to support IE6 and your site has partial https usage you can remove the http as well: <script … Read more