Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instant copy-paste #6

Closed
neersighted opened this issue Aug 29, 2012 · 3 comments
Closed

Instant copy-paste #6

neersighted opened this issue Aug 29, 2012 · 3 comments

Comments

@neersighted
Copy link
Contributor

Editing the index.html file to serve the CSS off of raw.github.com would me people would not need the asset locally, but would mean that if Github goes down, so does the ribbon. Thoughts?

@simonwhitaker
Copy link
Owner

I had the same thought – basically that you could use GitHub as a rough-and-ready Content Delivery Network (CDN). However, I did some investigation and it sounds as though hosting from raw.github.com is not the way to go.

A Google search on "github as cdn" comes up with GitHub as a CDN, which suggests using Google Pages as a CDN. That looks like it'd work better (it sets an HTTP Expires header that's 24 hours from now), but not sure if it's what you'd expect (or want) from a proper CDN. See below for HTTP headers from a call to raw.github.com, a call to the corresponding Github Pages URL, and (for comparison) a call to the Google CDN link for jQuery 1.8.0.

$ curl -s -o /dev/null -D - https://raw.github.com/simonwhitaker/github-fork-ribbon-css/master/gh-fork-ribbon.css
HTTP/1.1 200 OK
Server: nginx/1.0.13
Date: Wed, 29 Aug 2012 13:20:57 GMT
Content-Type: text/plain; charset=utf-8
Connection: keep-alive
Status: 200 OK
X-Frame-Options: deny
X-RateLimit-Remaining: 100
Content-Transfer-Encoding: binary
X-RateLimit-Limit: 100
ETag: "82998edc12e52d04f393ca2c79dd757c"
Content-Length: 2732
Cache-Control: private
X-Runtime: 10
X-Content-Type-Options: nosniff
Content-Disposition: inline

$ curl -s -o /dev/null -D - http:https://simonwhitaker.github.com/github-fork-ribbon-css/gh-fork-ribbon.css
HTTP/1.1 200 OK
Server: nginx/1.0.13
Date: Wed, 29 Aug 2012 13:21:02 GMT
Content-Type: text/css
Content-Length: 2732
Last-Modified: Wed, 29 Aug 2012 04:05:50 GMT
Connection: keep-alive
Expires: Thu, 30 Aug 2012 13:21:02 GMT
Cache-Control: max-age=86400
Accept-Ranges: bytes

$ curl -s -o /dev/null -D - https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: text/javascript; charset=UTF-8
Last-Modified: Fri, 10 Aug 2012 20:05:59 GMT
Date: Thu, 23 Aug 2012 01:57:22 GMT
Expires: Fri, 23 Aug 2013 01:57:22 GMT
X-Content-Type-Options: nosniff
Server: sffe
X-XSS-Protection: 1; mode=block
Cache-Control: public, max-age=31536000
Age: 559468
Transfer-Encoding: chunked

@simonwhitaker
Copy link
Owner

So in short, I'm going to close this issue. It's OK to let people grab the assets for themselves for the time being.

@neersighted
Copy link
Contributor Author

@simonwhitaker One other possibility is serving it off Heroku (AWS East 2), using my nginx build pack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants