{"action":"created","issue":{"url":"https://api.github.com/repos/Clever/ci-scripts/issues/23","repository_url":"https://api.github.com/repos/Clever/ci-scripts","labels_url":"https://api.github.com/repos/Clever/ci-scripts/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/Clever/ci-scripts/issues/23/comments","events_url":"https://api.github.com/repos/Clever/ci-scripts/issues/23/events","html_url":"https://github.com/Clever/ci-scripts/pull/23","id":213868814,"number":23,"title":"Adds cache-control header to assets uploaded to s3","user":{"login":"alsmola","id":653310,"avatar_url":"https://avatars3.githubusercontent.com/u/653310?v=3","gravatar_id":"","url":"https://api.github.com/users/alsmola","html_url":"https://github.com/alsmola","followers_url":"https://api.github.com/users/alsmola/followers","following_url":"https://api.github.com/users/alsmola/following{/other_user}","gists_url":"https://api.github.com/users/alsmola/gists{/gist_id}","starred_url":"https://api.github.com/users/alsmola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alsmola/subscriptions","organizations_url":"https://api.github.com/users/alsmola/orgs","repos_url":"https://api.github.com/users/alsmola/repos","events_url":"https://api.github.com/users/alsmola/events{/privacy}","received_events_url":"https://api.github.com/users/alsmola/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jefff","id":124665,"avatar_url":"https://avatars1.githubusercontent.com/u/124665?v=3","gravatar_id":"","url":"https://api.github.com/users/jefff","html_url":"https://github.com/jefff","followers_url":"https://api.github.com/users/jefff/followers","following_url":"https://api.github.com/users/jefff/following{/other_user}","gists_url":"https://api.github.com/users/jefff/gists{/gist_id}","starred_url":"https://api.github.com/users/jefff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefff/subscriptions","organizations_url":"https://api.github.com/users/jefff/orgs","repos_url":"https://api.github.com/users/jefff/repos","events_url":"https://api.github.com/users/jefff/events{/privacy}","received_events_url":"https://api.github.com/users/jefff/received_events","type":"User","site_admin":false},"assignees":[{"login":"jefff","id":124665,"avatar_url":"https://avatars1.githubusercontent.com/u/124665?v=3","gravatar_id":"","url":"https://api.github.com/users/jefff","html_url":"https://github.com/jefff","followers_url":"https://api.github.com/users/jefff/followers","following_url":"https://api.github.com/users/jefff/following{/other_user}","gists_url":"https://api.github.com/users/jefff/gists{/gist_id}","starred_url":"https://api.github.com/users/jefff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefff/subscriptions","organizations_url":"https://api.github.com/users/jefff/orgs","repos_url":"https://api.github.com/users/jefff/repos","events_url":"https://api.github.com/users/jefff/events{/privacy}","received_events_url":"https://api.github.com/users/jefff/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2017-03-13T19:13:52Z","updated_at":"2017-03-13T23:10:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Clever/ci-scripts/pulls/23","html_url":"https://github.com/Clever/ci-scripts/pull/23","diff_url":"https://github.com/Clever/ci-scripts/pull/23.diff","patch_url":"https://github.com/Clever/ci-scripts/pull/23.patch"},"body":"Our primary CloudFront costs come from the bandwidth and requests of serving assets to users.\r\n\r\nYou can see the costs in the billing dashboard: https://console.aws.amazon.com/billing/home?region=us-west-1#/bill?year=2017&month=3\r\n\r\nYou can look at the reports for the different caches to see how many requests `assets.clever.com` is doing compared to the rest: https://console.aws.amazon.com/cloudfront/home?region=us-west-1#cache_stat_reports:\r\n\r\nThe CloudFront for assets.clever.com serves a lot of requests for fonts, scripts, etc: https://console.aws.amazon.com/cloudfront/home?region=us-west-1#popular_urls:\r\n\r\nI think we should be able to cache our assets in users' browsers. This is inspired by this article: http://snowplowanalytics.com/blog/2013/07/02/reduce-your-cloudfront-bills-with-cache-control/\r\n\r\nSince our assets never should change (we should just publish a new version), I figured we should cache as long as we can. Apparently, one year is the standard max `max-age` value: http://stackoverflow.com/a/25201898/2967120\r\n\r\nIf we do somehow add a `cache-control` header with a bad value to our sites, it could be difficult to change. However, I think that since we should always use `s3-upload` into a commit-namespaced folder, we should be fine.\r\n\r\n-Not sure this will work with clever-components - verifying- should work now, see https://github.com/Clever/components/pull/133\r\n"},"comment":{"url":"https://api.github.com/repos/Clever/ci-scripts/issues/comments/286272251","html_url":"https://github.com/Clever/ci-scripts/pull/23#issuecomment-286272251","issue_url":"https://api.github.com/repos/Clever/ci-scripts/issues/23","id":286272251,"user":{"login":"nathanleiby","id":102242,"avatar_url":"https://avatars0.githubusercontent.com/u/102242?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanleiby","html_url":"https://github.com/nathanleiby","followers_url":"https://api.github.com/users/nathanleiby/followers","following_url":"https://api.github.com/users/nathanleiby/following{/other_user}","gists_url":"https://api.github.com/users/nathanleiby/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanleiby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanleiby/subscriptions","organizations_url":"https://api.github.com/users/nathanleiby/orgs","repos_url":"https://api.github.com/users/nathanleiby/repos","events_url":"https://api.github.com/users/nathanleiby/events{/privacy}","received_events_url":"https://api.github.com/users/nathanleiby/received_events","type":"User","site_admin":false},"created_at":"2017-03-13T23:10:36Z","updated_at":"2017-03-13T23:10:36Z","body":"Thanks for the explanation! \r\n\r\nSince we only use this plugin for assets right now, caching makes sense to me. Might need to make it configurable in the future, if we wanted to upload something else where it's not applicable."}}
{"actor":{"display_login":"nathanleiby"}}