{"action":"created","issue":{"url":"https://api.github.com/repos/jimmynicol/image-resizer/issues/27","labels_url":"https://api.github.com/repos/jimmynicol/image-resizer/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/jimmynicol/image-resizer/issues/27/comments","events_url":"https://api.github.com/repos/jimmynicol/image-resizer/issues/27/events","html_url":"https://github.com/jimmynicol/image-resizer/issues/27","id":52800409,"number":27,"title":"Constantly Missing from Cloudfront cache - possibly due to incorrect cache headers from image-resizer?","user":{"login":"J-Gonzalez","id":1047598,"avatar_url":"https://avatars.githubusercontent.com/u/1047598?v=3","gravatar_id":"","url":"https://api.github.com/users/J-Gonzalez","html_url":"https://github.com/J-Gonzalez","followers_url":"https://api.github.com/users/J-Gonzalez/followers","following_url":"https://api.github.com/users/J-Gonzalez/following{/other_user}","gists_url":"https://api.github.com/users/J-Gonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/J-Gonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/J-Gonzalez/subscriptions","organizations_url":"https://api.github.com/users/J-Gonzalez/orgs","repos_url":"https://api.github.com/users/J-Gonzalez/repos","events_url":"https://api.github.com/users/J-Gonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/J-Gonzalez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-12-24T06:57:37Z","updated_at":"2015-01-02T20:53:29Z","closed_at":null,"body":"I've got my Cloudfront Cache Behavior settings to Use Origin Cache Headers from my Image Resizer origin.  I however keep getting Misses from Cloudfront as if it's not caching the files correctly. I'm not sure if this is due to me sending the files to S3 originally with incorrect cache headers and image-resizer is just passing them on, or if I've configured image resizer incorrectly.  Ideally I'd like to be able to set the cache expiry time in image resizer. I'm deployed to Heroku.\r\n\r\nI've tried using IMAGE_EXPIRY node env (and setting to 7776000) and before also had the following code in my image servers index.js:\r\n```\r\nresponse.setHeader('Cache-Control', 'public, max-age=' + 6048000);\r\n```\r\n\r\nIt seems that some images are Hits from Cloudfront, while many others are a Miss, even after refreshing the page multiple times, they still miss."},"comment":{"url":"https://api.github.com/repos/jimmynicol/image-resizer/issues/comments/68561318","html_url":"https://github.com/jimmynicol/image-resizer/issues/27#issuecomment-68561318","issue_url":"https://api.github.com/repos/jimmynicol/image-resizer/issues/27","id":68561318,"user":{"login":"jimmynicol","id":447507,"avatar_url":"https://avatars.githubusercontent.com/u/447507?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmynicol","html_url":"https://github.com/jimmynicol","followers_url":"https://api.github.com/users/jimmynicol/followers","following_url":"https://api.github.com/users/jimmynicol/following{/other_user}","gists_url":"https://api.github.com/users/jimmynicol/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmynicol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmynicol/subscriptions","organizations_url":"https://api.github.com/users/jimmynicol/orgs","repos_url":"https://api.github.com/users/jimmynicol/repos","events_url":"https://api.github.com/users/jimmynicol/events{/privacy}","received_events_url":"https://api.github.com/users/jimmynicol/received_events","type":"User","site_admin":false},"created_at":"2015-01-02T20:53:29Z","updated_at":"2015-01-02T20:53:29Z","body":"@J-Gonzalez, I have been digging into this. I took a look at the link you showed and was not seeing any misses from the cache. Have you made any modifications that may have gotten this working? I would love to be able to fix anything that was missing.\r\n\r\nI have also been re-reading this: \r\n\r\nhttp://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html\r\n\r\nAnd I am fairly certain the default cache behaviour from `image-resizer` is doing what it should be. We set the following headers: `Expires`, `Cache-Control`, `Vary`, `Last-Modified`.\r\n\r\nAnyway please let me know if this is still an issue, or if you discovered anything note worthy."}}