Anahkiasen / cookie-monster

A rehosted, cleaned up and updated version of the CookieMonster plugin.
31 stars 24 forks source link

Use Github Pages to reduce server load #56

Open Mooninaut opened 10 years ago

Mooninaut commented 10 years ago

http://code.lancepollard.com/github-as-a-cdn/

https://pages.github.com/

I've noticed quite a few sites linking to the raw file directly from a non Github Pages repository branch like this:

http://github.com/viatropos/cached-commons/raw/master/javascripts/jquery/jquery-1.4.2-min.js

This seems like a good idea but it's not. When you request the raw file like that, you're not directly accessing the file from the filesystem! You're going through layers of application code too, which will definitely slow your site down. Don't do that. Instead, create a gh-pages branch, and load it from there like this:

http://viatropos.github.com/cached-commons/javascripts/jquery/jquery-1.4.2-min.js

That reads directly from the file system.