Skip to content

Instantly share code, notes, and snippets.

@pengwynn
Created October 3, 2013 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pengwynn/6815412 to your computer and use it in GitHub Desktop.
Save pengwynn/6815412 to your computer and use it in GitHub Desktop.
Conditional caching for Releases API
❯ curl -n -I -H"Accept: application/vnd.github.manifold-preview" https://api.github.com/repos/octokit/octokit.rb/releases
HTTP/1.1 200 OK
Server: GitHub.com
Date: Thu, 03 Oct 2013 19:11:09 GMT
Content-Type: application/json; charset=utf-8
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4998
X-RateLimit-Reset: 1380831057
Cache-Control: private, max-age=60, s-maxage=60
Last-Modified: Thu, 03 Oct 2013 05:36:12 GMT
ETag: "943a4688c4fd6c6e4d46ddf4377dff67"
Vary: Accept, Authorization, Cookie
X-GitHub-Media-Type: github.manifold-preview
X-Content-Type-Options: nosniff
Content-Length: 10218
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
Access-Control-Allow-Origin: *
X-GitHub-Request-Id: 4AC49B86:1FA3:13DCE75:524DC14C
Vary: Accept-Encoding
❯ curl -n -I -H"Accept: application/vnd.github.manifold-preview" -H"If-Modified-Since: Thu, 03 Oct 2013 05:36:12 GMT" https://api.github.com/repos/octokit/octokit.rb/releases
HTTP/1.1 304 Not Modified
Server: GitHub.com
Date: Thu, 03 Oct 2013 19:11:53 GMT
Status: 304 Not Modified
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4998
X-RateLimit-Reset: 1380831057
Cache-Control: private, max-age=60, s-maxage=60
Last-Modified: Thu, 03 Oct 2013 05:36:12 GMT
X-Content-Type-Options: nosniff
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
Access-Control-Allow-Origin: *
X-GitHub-Request-Id: 4AC49B86:3B8C:134D705:524DC179
Vary: Accept-Encoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment