{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/621","labels_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/621/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/621/comments","events_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/621/events","html_url":"https://github.com/mozilla/thimble.webmaker.org/issues/621","id":91398476,"number":621,"title":"Tune cache-related headers for Bramble and Thimble","user":{"login":"humphd","id":427398,"avatar_url":"https://avatars.githubusercontent.com/u/427398?v=3","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/labels/enhancement","name":"enhancement","color":"d4c5f9"},{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/labels/P2","name":"P2","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"sedge","id":1616860,"avatar_url":"https://avatars.githubusercontent.com/u/1616860?v=3","gravatar_id":"","url":"https://api.github.com/users/sedge","html_url":"https://github.com/sedge","followers_url":"https://api.github.com/users/sedge/followers","following_url":"https://api.github.com/users/sedge/following{/other_user}","gists_url":"https://api.github.com/users/sedge/gists{/gist_id}","starred_url":"https://api.github.com/users/sedge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sedge/subscriptions","organizations_url":"https://api.github.com/users/sedge/orgs","repos_url":"https://api.github.com/users/sedge/repos","events_url":"https://api.github.com/users/sedge/events{/privacy}","received_events_url":"https://api.github.com/users/sedge/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/milestones/12","html_url":"https://github.com/mozilla/thimble.webmaker.org/milestones/Final%20stride","labels_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/milestones/12/labels","id":1340520,"number":12,"title":"Final stride","description":"The CDOT core team's last (supposedly) push on fixing critical/major features/bugs.","creator":{"login":"humphd","id":427398,"avatar_url":"https://avatars.githubusercontent.com/u/427398?v=3","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":33,"state":"open","created_at":"2015-10-06T15:20:07Z","updated_at":"2015-12-03T00:05:54Z","due_on":"2015-12-24T05:00:00Z","closed_at":null},"comments":7,"created_at":"2015-06-27T01:30:26Z","updated_at":"2015-12-03T22:31:40Z","closed_at":null,"body":"We're missing the cache more often than we should be, and it would be good if we tuned the two parts of our app so that they allow caching as much as possible.  https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers has some good discussion of what needs to be done here.\r\n\r\nLet's audit both our Express app for Thimble, and also how we serve the Bramble stuff on S3/nginx.  For example, here's what we send for the `bramble.js` api lib:\r\n\r\n```\r\ncurl -I https://mozillathimblelivepreview.net/bramble/dist/bramble.js\r\nHTTP/1.1 200 OK\r\nContent-Encoding: gzip\r\nContent-Length: 36246\r\nContent-Type: application/javascript\r\nDate: Sat, 27 Jun 2015 01:37:08 GMT\r\nETag: \"645af570134b3679aeb7c2ac200857dc\"\r\nLast-Modified: Fri, 26 Jun 2015 20:31:55 GMT\r\nServer: nginx/1.1.19\r\nx-amz-id-2: 0BJt5rRj2bsOZrVKpfRyeOUpnFLJQrFaE0SpTo0ZVg+NhugL4PaIDGGCJioAZb+Y\r\nx-amz-request-id: 7DD48252CE1E9B98\r\nConnection: keep-alive\r\n```\r\n\r\nAnd here's Thimble:\r\n\r\n```\r\ncurl -I https://thimble.webmaker.org/\r\nHTTP/1.1 200 OK\r\nContent-Length: 13801\r\nContent-Security-Policy-Report-Only: connect-src 'self' http://*.log.optimizely.com https://*.log.optimizely.com wss://hub.togetherjs.com; default-src 'self'; frame-src 'self' https://docs.google.com https://mozillathimblelivepreview.net/previewloader.html https://login.persona.org; font-src 'self' https://togetherjs.com; img-src *; media-src *; script-src 'self' 'unsafe-inline' 'unsafe-eval' http://mozorg.cdn.mozilla.net http://*.newrelic.com https://*.newrelic.com https://cdn.optimizely.com https://ajax.googleapis.com https://mozorg.cdn.mozilla.net https://ssl.google-analytics.com https://www.youtube.com https://s.ytimg.com https://login.persona.org https://togetherjs.com; style-src 'self' 'unsafe-inline' http://mozorg.cdn.mozilla.net https://ajax.googleapis.com https://fonts.googleapis.com https://mozorg.cdn.mozilla.net https://togetherjs.com;\r\nContent-Type: text/html; charset=utf-8\r\nDate: Sat, 27 Jun 2015 01:26:10 GMT\r\nSet-Cookie: webmakerlogin=s%3Aj%3A%7B%22_csrfSecret%22%3A%22TJZM0temgo7ZY0CceT3BoBKQ%22%7D.FK43ymyyjEFWOKydmGJ%2BN4nIWkfVsNAxsv6iRakYNNs; Domain=webmaker.org; Path=/; HttpOnly; Secure\r\nStrict-Transport-Security: max-age=15768000\r\nVary: Accept-Encoding\r\nX-Content-Type-Options: nosniff\r\nX-FRAME-OPTIONS: DENY\r\nX-XSS-Protection: 1; mode=block\r\nConnection: keep-alive\r\n```\r\n\r\nNo `Cache-Control` or `Expires` in either.  We can do better here.\r\n\r\ncc @jbuck "},"comment":{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/comments/161808580","html_url":"https://github.com/mozilla/thimble.webmaker.org/issues/621#issuecomment-161808580","issue_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/621","id":161808580,"user":{"login":"jbuck","id":578466,"avatar_url":"https://avatars.githubusercontent.com/u/578466?v=3","gravatar_id":"","url":"https://api.github.com/users/jbuck","html_url":"https://github.com/jbuck","followers_url":"https://api.github.com/users/jbuck/followers","following_url":"https://api.github.com/users/jbuck/following{/other_user}","gists_url":"https://api.github.com/users/jbuck/gists{/gist_id}","starred_url":"https://api.github.com/users/jbuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbuck/subscriptions","organizations_url":"https://api.github.com/users/jbuck/orgs","repos_url":"https://api.github.com/users/jbuck/repos","events_url":"https://api.github.com/users/jbuck/events{/privacy}","received_events_url":"https://api.github.com/users/jbuck/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T22:31:40Z","updated_at":"2015-12-03T22:31:40Z","body":"The etag header is only useful for the browser. Versioned objects mean that you don't need to run an invalidation when you update an object: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ReplacingObjects.html"}}