{"action":"created","issue":{"url":"https://api.github.com/repos/refile/refile/issues/209","labels_url":"https://api.github.com/repos/refile/refile/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/refile/refile/issues/209/comments","events_url":"https://api.github.com/repos/refile/refile/issues/209/events","html_url":"https://github.com/refile/refile/issues/209","id":71522737,"number":209,"title":"Nginx as caching proxy","user":{"login":"dspaeth-faber","id":7701058,"avatar_url":"https://avatars.githubusercontent.com/u/7701058?v=3","gravatar_id":"","url":"https://api.github.com/users/dspaeth-faber","html_url":"https://github.com/dspaeth-faber","followers_url":"https://api.github.com/users/dspaeth-faber/followers","following_url":"https://api.github.com/users/dspaeth-faber/following{/other_user}","gists_url":"https://api.github.com/users/dspaeth-faber/gists{/gist_id}","starred_url":"https://api.github.com/users/dspaeth-faber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dspaeth-faber/subscriptions","organizations_url":"https://api.github.com/users/dspaeth-faber/orgs","repos_url":"https://api.github.com/users/dspaeth-faber/repos","events_url":"https://api.github.com/users/dspaeth-faber/events{/privacy}","received_events_url":"https://api.github.com/users/dspaeth-faber/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-28T08:31:32Z","updated_at":"2015-04-28T12:20:30Z","closed_at":null,"body":"Quote from: krists/refile-postgres#3\r\n\r\nServing the content directly through the Rails-App is expensive. So I configured my \r\nasset host (nginx) as an caching proxy. Maybe someone can use it too, so I like to share it.\r\n\r\nI don't know where to put it. Maybe as an example would it be good.\r\n\r\n\r\n```ruby\r\nhttp {\r\n ...\r\nproxy_cache_path /.../shared/public/uploads levels=1:2 keys_zone=my_app_production:250m inactive=6000m;\r\n\r\nserver {\r\n  server_name assets.my-app.example.com\r\n   proxy_cache my_app_production;\r\n   location  ^~ /attachments/ {\r\n\r\ngzip_static on;\r\n    expires max;\r\n    add_header Cache-Control public;\r\n    add_header X-Proxy-Cache $upstream_cache_status;\r\n\r\n    proxy_ignore_headers Set-Cookie Cache-Control Expires;\r\n    proxy_cache_key $host$uri$is_args$args;\r\n    proxy_hide_header Set-Cookie;\r\n    proxy_hide_header Cache-Control;\r\n    proxy_hide_header Expires;\r\n    proxy_cache_valid 200 600m;\r\n\r\n    proxy_store_access user:rw group:rw all:r;\r\n    proxy_store        on;\r\n\r\n    proxy_cache_bypass        $http_secret_header;\r\n\r\n    proxy_pass http://www.my-app.example.com ;\r\n    \r\n   }\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/refile/refile/issues/comments/97041720","html_url":"https://github.com/refile/refile/issues/209#issuecomment-97041720","issue_url":"https://api.github.com/repos/refile/refile/issues/209","id":97041720,"user":{"login":"jnicklas","id":134,"avatar_url":"https://avatars.githubusercontent.com/u/134?v=3","gravatar_id":"","url":"https://api.github.com/users/jnicklas","html_url":"https://github.com/jnicklas","followers_url":"https://api.github.com/users/jnicklas/followers","following_url":"https://api.github.com/users/jnicklas/following{/other_user}","gists_url":"https://api.github.com/users/jnicklas/gists{/gist_id}","starred_url":"https://api.github.com/users/jnicklas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnicklas/subscriptions","organizations_url":"https://api.github.com/users/jnicklas/orgs","repos_url":"https://api.github.com/users/jnicklas/repos","events_url":"https://api.github.com/users/jnicklas/events{/privacy}","received_events_url":"https://api.github.com/users/jnicklas/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T12:20:30Z","updated_at":"2015-04-28T12:20:30Z","body":"@dspaeth-faber I haven't investigated this much at all. `:must_revalidate` could well be the wrong choice. "}}