{"action":"created","issue":{"url":"https://api.github.com/repos/LevelbossMike/ember-deploy-redis/issues/21","labels_url":"https://api.github.com/repos/LevelbossMike/ember-deploy-redis/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/LevelbossMike/ember-deploy-redis/issues/21/comments","events_url":"https://api.github.com/repos/LevelbossMike/ember-deploy-redis/issues/21/events","html_url":"https://github.com/LevelbossMike/ember-deploy-redis/issues/21","id":109239353,"number":21,"title":"Stash checksum and/or timestamp in Redis","user":{"login":"mwpastore","id":8540936,"avatar_url":"https://avatars.githubusercontent.com/u/8540936?v=3","gravatar_id":"","url":"https://api.github.com/users/mwpastore","html_url":"https://github.com/mwpastore","followers_url":"https://api.github.com/users/mwpastore/followers","following_url":"https://api.github.com/users/mwpastore/following{/other_user}","gists_url":"https://api.github.com/users/mwpastore/gists{/gist_id}","starred_url":"https://api.github.com/users/mwpastore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwpastore/subscriptions","organizations_url":"https://api.github.com/users/mwpastore/orgs","repos_url":"https://api.github.com/users/mwpastore/repos","events_url":"https://api.github.com/users/mwpastore/events{/privacy}","received_events_url":"https://api.github.com/users/mwpastore/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-01T06:40:03Z","updated_at":"2015-10-01T07:14:45Z","closed_at":null,"body":"It would be fantastic if ember-deploy-redis would also stash a checksum (or the commit SHA) and/or a build date/time (or the commit timestamp) of the index to use in the the `ETag` and `Last-Modified` HTTP headers. Something like: \r\n\r\n```\r\nfoo:index:current => '<!DOCTYPE html>...'\r\nfoo:index:current:meta => checksum '787b3dd284fd99202adfa4e18a28126d159552c5' \r\n                          timestamp 'Wed Sep 16 19:28:37 2015 +0200'\r\n```\r\n\r\nAnd then...\r\n\r\n```ruby\r\nrequire 'sinatra'\r\nrequire 'redis'\r\n\r\nget '/' do\r\n  content_type 'text/html'\r\n  expires 3_600, :public\r\n\r\n  redis = Redis.new\r\n  index_key = redis.get(\"foo:current\")\r\n  index_key = \"foo:#{params[:index_key]}\" if params[:index_key]\r\n\r\n  meta = redis.hgetall(\"#{index_key}:meta\")\r\n  etag meta[:checksum]\r\n  last_modified meta[:timestamp]\r\n\r\n  redis.get(index_key)\r\nend\r\n```\r\n\r\nStashing the content in the same hash as the metadata would be ideal (to limit the Redis hits) but would break backwards compatibility."},"comment":{"url":"https://api.github.com/repos/LevelbossMike/ember-deploy-redis/issues/comments/144640947","html_url":"https://github.com/LevelbossMike/ember-deploy-redis/issues/21#issuecomment-144640947","issue_url":"https://api.github.com/repos/LevelbossMike/ember-deploy-redis/issues/21","id":144640947,"user":{"login":"mwpastore","id":8540936,"avatar_url":"https://avatars.githubusercontent.com/u/8540936?v=3","gravatar_id":"","url":"https://api.github.com/users/mwpastore","html_url":"https://github.com/mwpastore","followers_url":"https://api.github.com/users/mwpastore/followers","following_url":"https://api.github.com/users/mwpastore/following{/other_user}","gists_url":"https://api.github.com/users/mwpastore/gists{/gist_id}","starred_url":"https://api.github.com/users/mwpastore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwpastore/subscriptions","organizations_url":"https://api.github.com/users/mwpastore/orgs","repos_url":"https://api.github.com/users/mwpastore/repos","events_url":"https://api.github.com/users/mwpastore/events{/privacy}","received_events_url":"https://api.github.com/users/mwpastore/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T07:14:44Z","updated_at":"2015-10-01T07:14:44Z","body":"Will do!"}}