{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/26681","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/26681/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/26681/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/26681/events","html_url":"https://github.com/symfony/symfony/pull/26681","id":308880882,"number":26681,"title":"Allow to easily ask Symfony not to set a response to private automatically","user":{"login":"Toflar","id":481937,"avatar_url":"https://avatars2.githubusercontent.com/u/481937?v=4","gravatar_id":"","url":"https://api.github.com/users/Toflar","html_url":"https://github.com/Toflar","followers_url":"https://api.github.com/users/Toflar/followers","following_url":"https://api.github.com/users/Toflar/following{/other_user}","gists_url":"https://api.github.com/users/Toflar/gists{/gist_id}","starred_url":"https://api.github.com/users/Toflar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Toflar/subscriptions","organizations_url":"https://api.github.com/users/Toflar/orgs","repos_url":"https://api.github.com/users/Toflar/repos","events_url":"https://api.github.com/users/Toflar/events{/privacy}","received_events_url":"https://api.github.com/users/Toflar/received_events","type":"User","site_admin":false},"labels":[{"id":100378,"url":"https://api.github.com/repos/symfony/symfony/labels/Feature","name":"Feature","color":"02e10c","default":false},{"id":237550465,"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Reviewed","name":"Status: Reviewed","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-27T09:01:57Z","updated_at":"2018-03-27T11:42:22Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/26681","html_url":"https://github.com/symfony/symfony/pull/26681","diff_url":"https://github.com/symfony/symfony/pull/26681.diff","patch_url":"https://github.com/symfony/symfony/pull/26681.patch"},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | \r\n| License       | MIT\r\n| Doc PR        | \r\n\r\nThis PR is related to the many discussions going on about the latest (Symfony 3.4+) changes regarding the way Symfony handles the session. I think we're almost there now, Symfony 4.1 automatically turns responses into `private` responses once the session is started and it's all done in the `AbstractSessionListener` where the session is also saved. \r\nIn other issues/PRs (https://github.com/symfony/symfony/pull/25583, https://github.com/symfony/symfony/pull/25699, https://github.com/symfony/symfony/issues/24988) it was agreed that setting the response to `private` if the session is started is a good default for Symfony. It was also agreed that setting it to `private` does not always make sense because you **can share a response** across sessions, it just requires a more complex caching setup with shared user context etc.\r\nSo there must be an easy way to disable this behaviour. Right now it's very hard to do so because what you end up doing is basically decorating the `session_listener` which is very hard because you have to keep track on that over different Symfony versions as the base listener might get additional features etc.\r\n\r\nThe [FOSCacheBundle](https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/pull/438) is already having this problem, [Contao](https://github.com/contao/core-bundle/pull/1388) has the same issue and there will be probably more. Basically everyone that wants to share a response cache across the session will have to decorate the default listener. That's just too hard, so I came up with this solution. The header is easy. Every project can add that easily. It does not require any extension, configuration or adjustment of any service. It's clean, transparent and has absolutely no impact on \"default\" Symfony setups.\r\n\r\nWould be happy to have some feedback before 4.1 freeze."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/376494323","html_url":"https://github.com/symfony/symfony/pull/26681#issuecomment-376494323","issue_url":"https://api.github.com/repos/symfony/symfony/issues/26681","id":376494323,"user":{"login":"Toflar","id":481937,"avatar_url":"https://avatars2.githubusercontent.com/u/481937?v=4","gravatar_id":"","url":"https://api.github.com/users/Toflar","html_url":"https://github.com/Toflar","followers_url":"https://api.github.com/users/Toflar/followers","following_url":"https://api.github.com/users/Toflar/following{/other_user}","gists_url":"https://api.github.com/users/Toflar/gists{/gist_id}","starred_url":"https://api.github.com/users/Toflar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Toflar/subscriptions","organizations_url":"https://api.github.com/users/Toflar/orgs","repos_url":"https://api.github.com/users/Toflar/repos","events_url":"https://api.github.com/users/Toflar/events{/privacy}","received_events_url":"https://api.github.com/users/Toflar/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T11:42:22Z","updated_at":"2018-03-27T11:42:22Z","author_association":"CONTRIBUTOR","body":"@stof There's a lot more to consider, you are right. This is why Symfony defaults to setting the response `private` and it's what I meant by \"requires a more complex caching setup\". All this PR is about is that it's very hard to disable the current behaviour of Symfony and I don't think this is a good thing."}}
{"actor":{"display_login":"Toflar"}}