{"action":"created","issue":{"url":"https://api.github.com/repos/mocdk/MOC.Varnish/issues/22","labels_url":"https://api.github.com/repos/mocdk/MOC.Varnish/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/mocdk/MOC.Varnish/issues/22/comments","events_url":"https://api.github.com/repos/mocdk/MOC.Varnish/issues/22/events","html_url":"https://github.com/mocdk/MOC.Varnish/pull/22","id":101119023,"number":22,"title":"If the backend sends a no-cache header - respect that.","user":{"login":"daniellienert","id":642226,"avatar_url":"https://avatars.githubusercontent.com/u/642226?v=3","gravatar_id":"","url":"https://api.github.com/users/daniellienert","html_url":"https://github.com/daniellienert","followers_url":"https://api.github.com/users/daniellienert/followers","following_url":"https://api.github.com/users/daniellienert/following{/other_user}","gists_url":"https://api.github.com/users/daniellienert/gists{/gist_id}","starred_url":"https://api.github.com/users/daniellienert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniellienert/subscriptions","organizations_url":"https://api.github.com/users/daniellienert/orgs","repos_url":"https://api.github.com/users/daniellienert/repos","events_url":"https://api.github.com/users/daniellienert/events{/privacy}","received_events_url":"https://api.github.com/users/daniellienert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-14T22:59:33Z","updated_at":"2015-08-15T09:06:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mocdk/MOC.Varnish/pulls/22","html_url":"https://github.com/mocdk/MOC.Varnish/pull/22","diff_url":"https://github.com/mocdk/MOC.Varnish/pull/22.diff","patch_url":"https://github.com/mocdk/MOC.Varnish/pull/22.patch"},"body":"This is necessary, because the extension will not send the specific cache headers if the request is marked as uncached.\r\nWithout these headers, the cache invalidation doesnt work due to missing X-Site header and others."},"comment":{"url":"https://api.github.com/repos/mocdk/MOC.Varnish/issues/comments/131318987","html_url":"https://github.com/mocdk/MOC.Varnish/pull/22#issuecomment-131318987","issue_url":"https://api.github.com/repos/mocdk/MOC.Varnish/issues/22","id":131318987,"user":{"login":"aertmann","id":903567,"avatar_url":"https://avatars.githubusercontent.com/u/903567?v=3","gravatar_id":"","url":"https://api.github.com/users/aertmann","html_url":"https://github.com/aertmann","followers_url":"https://api.github.com/users/aertmann/followers","following_url":"https://api.github.com/users/aertmann/following{/other_user}","gists_url":"https://api.github.com/users/aertmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aertmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aertmann/subscriptions","organizations_url":"https://api.github.com/users/aertmann/orgs","repos_url":"https://api.github.com/users/aertmann/repos","events_url":"https://api.github.com/users/aertmann/events{/privacy}","received_events_url":"https://api.github.com/users/aertmann/received_events","type":"User","site_admin":false},"created_at":"2015-08-15T09:06:19Z","updated_at":"2015-08-15T09:06:19Z","body":"Hi Daniel, thanks for submitting.\r\n\r\nThe configuration is actually just copied from the Symfony package, however I think it makes sense to add such configuration to help people.\r\n\r\nBut you need to add it to both versions of the varnish configuration (v3 + v4).\r\n\r\nAdditionally in our configuration we do a bit more for \"no-cache\" requests.\r\n\r\n```\r\n\t# Respect force-reload, and clear cache accordingly. This means that a ctrl-reload will actually purge\r\n\t# the cache for this URL.\r\n\tif (req.http.Cache-Control ~ \"no-cache\") {\r\n\t\tset beresp.ttl = 0s;\r\n\t\t#Make sure ESI includes are processed!\r\n\t\tset beresp.do_esi = true;\r\n\t\tset beresp.http.X-Cacheable = \"NO:force-reload\";\r\n\t\t#Make sure that We remove alle cache headers, so the Browser does not cache it for us!\r\n\t\tremove beresp.http.Cache-Control;\r\n\t\tremove beresp.http.Expires;\r\n\t\tremove beresp.http.Last-Modified;\r\n\t\tremove beresp.http.ETag;\r\n\t\tremove beresp.http.Pragma;\r\n\r\n\t\treturn (deliver);\r\n\t}\r\n```\r\n\r\nadditionally we have this in \"vcl_hit\"\r\n\r\n```\r\nsub vcl_hit {\r\n\t# General hit vcl\r\n\tif (req.http.Cache-Control ~ \"no-cache\") {\r\n\t\tset obj.ttl = 0s;\r\n\t\treturn (pass);\r\n\t}\r\n}\r\n```\r\n\r\nYou can find the whole configuration at https://github.com/mocdk/vagrant-moc/blob/master/templates/varnish.vcl.j2"}}