{"action":"created","comment":{"url":"https://api.github.com/repos/contao/core-bundle/pulls/comments/74086106","id":74086106,"diff_hunk":"@@ -240,103 +239,6 @@ public function hasAuthenticatedBackendUser()\n \n \n \t/**\n-\t * Add the template output to the cache and add the cache headers\n-\t */\n-\tprotected function addToCache()","path":"src/Resources/contao/classes/FrontendTemplate.php","position":34,"original_position":34,"commit_id":"e5cd8efde8cc403cf91e1b106e5ff6ca316e8a17","original_commit_id":"e5cd8efde8cc403cf91e1b106e5ff6ca316e8a17","user":{"login":"Toflar","id":481937,"avatar_url":"https://avatars.githubusercontent.com/u/481937?v=3","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},"body":"Okay, but it's not a use case we have to consider. If somebody uses the mobile layout, the SF reverse proxy has to consider this but the hook is not relevant.","created_at":"2016-08-09T15:50:38Z","updated_at":"2016-08-09T15:50:38Z","html_url":"https://github.com/contao/core-bundle/pull/562#discussion_r74086106","pull_request_url":"https://api.github.com/repos/contao/core-bundle/pulls/562","_links":{"self":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/comments/74086106"},"html":{"href":"https://github.com/contao/core-bundle/pull/562#discussion_r74086106"},"pull_request":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/562"}}},"pull_request":{"url":"https://api.github.com/repos/contao/core-bundle/pulls/562","id":80479267,"html_url":"https://github.com/contao/core-bundle/pull/562","diff_url":"https://github.com/contao/core-bundle/pull/562.diff","patch_url":"https://github.com/contao/core-bundle/pull/562.patch","issue_url":"https://api.github.com/repos/contao/core-bundle/issues/562","number":562,"state":"open","locked":false,"title":"[RFC] Feature/esi module","user":{"login":"Toflar","id":481937,"avatar_url":"https://avatars.githubusercontent.com/u/481937?v=3","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},"body":"Finally got it! ESI is quite complicated so I'll put this PR on RFC because I think there are a few things to discuss but it is working like a charm on my development environment already!\r\n\r\n## What ESI is\r\n\r\nFor the people not knowing about ESI: Please read this: https://en.wikipedia.org/wiki/Edge_Side_Includes\r\n\r\nBasically, you split up the website into different parts. The main request contains an arbitrary number of `<esi src=\"...>\"` tags which will be then evaluated and requested using a separate HTTP request. It is thus possible to e.g. cache your whole page for 2 days except for a shopping cart module.\r\n\r\n## What you can now do thanks to this PR\r\n\r\n- Configure caching settings for both, client and server cache per page (previously was a system setting so you could not distinguish).\r\n- Configure caching settings for every single front end module.\r\n\r\nIt's thus now very easy to e.g. cache your whole page on the client side for 1 minute (= no requests to the server at all), 2 days on the server side (= the server does not need to generate any content for this page) **except** for module A in the right column, module B in the footer etc. 😎 😎 😎 \r\n\r\n## What this PR does\r\n\r\n- Replaces the current very basic HTML output cache by the Symfony reverse proxy. I have taken this chance to enhance the caching settings in `tl_page` to be different for either the client or the server (reverse proxy) cache.\r\n\r\n- To support our \"uncacheable\" insert tags like `{{date}}` or `{{ua}}` or anything with the insert tag flag `uncached`, we now generate `<esi>` tags for them which will make sure, they are always re-rendered.\r\n\r\n- Adds regular expression filtering settings to the `AddToSearchIndexListener` because it shall not index on `/_fragment` requests (or whatever you configured it to be).\r\n\r\n- Adds ESI caching settings to every front end module. You can simply activate ESI and then choose from the various settings which I have included. Make sure you read the language files to understand why they are there and why they are useful. Together with @aschempp and @ausi  we have tried to think of many different use cases which is why the settings are there. E.g. the setting `ignore page information` can be useful if you know, your module (e.g. a simple `html` module) does not need any `global $objPage` information and you can thus improve the performance and cache usage (no `page` information in `<esi src=\"....\">` url = not different cache files per page) etc. I have even added support for our own `ResponseException`.\r\n\r\n![screen shot 2016-08-08 at 17 47 51](https://cloud.githubusercontent.com/assets/481937/17487198/198804bc-5d94-11e6-9c45-229dd65130bf.png)\r\n\r\n## Changes needed in config.yml\r\n\r\n```diff\r\n# Framework configuration\r\nframework:\r\n    ...\r\n    translator: { fallbacks: [\"%locale%\"] }\r\n+   #esi: { enabled: true }\r\n+   fragments: { enabled: true, path: /_fragment }\r\n```\r\n\r\nI'm really excited about this, hope you are too and looking forward to the comments 😄  🌞 \r\n\r\n## ToDo's\r\n\r\n- [ ] Unit tests\r\n- [ ] Update routine (tl_settings.cache should be considered and tl_page entries should be adjusted accordingly)\r\n- [ ] Consider BE_USER_LOGGED_IN and FE_USER_LOGGED_IN for ESI requests. Do we really need Vary header support?\r\n- [ ] How to consider TL_VIEW Cookie?\r\n\r\nPS: Commit messages are mostly nonsense, I'll squash everything once it's ready anyway.","created_at":"2016-08-08T16:16:11Z","updated_at":"2016-08-09T15:50:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a399280cb79aa231f6dd247bfaea12c0efd46c2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/contao/core-bundle/pulls/562/commits","review_comments_url":"https://api.github.com/repos/contao/core-bundle/pulls/562/comments","review_comment_url":"https://api.github.com/repos/contao/core-bundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/contao/core-bundle/issues/562/comments","statuses_url":"https://api.github.com/repos/contao/core-bundle/statuses/e5cd8efde8cc403cf91e1b106e5ff6ca316e8a17","head":{"label":"Toflar:feature/esi-module","ref":"feature/esi-module","sha":"e5cd8efde8cc403cf91e1b106e5ff6ca316e8a17","user":{"login":"Toflar","id":481937,"avatar_url":"https://avatars.githubusercontent.com/u/481937?v=3","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},"repo":{"id":26642166,"name":"core-bundle","full_name":"Toflar/core-bundle","owner":{"login":"Toflar","id":481937,"avatar_url":"https://avatars.githubusercontent.com/u/481937?v=3","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},"private":false,"html_url":"https://github.com/Toflar/core-bundle","description":"Contao 4 core bundle","fork":true,"url":"https://api.github.com/repos/Toflar/core-bundle","forks_url":"https://api.github.com/repos/Toflar/core-bundle/forks","keys_url":"https://api.github.com/repos/Toflar/core-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Toflar/core-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Toflar/core-bundle/teams","hooks_url":"https://api.github.com/repos/Toflar/core-bundle/hooks","issue_events_url":"https://api.github.com/repos/Toflar/core-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/Toflar/core-bundle/events","assignees_url":"https://api.github.com/repos/Toflar/core-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/Toflar/core-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/Toflar/core-bundle/tags","blobs_url":"https://api.github.com/repos/Toflar/core-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Toflar/core-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Toflar/core-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Toflar/core-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Toflar/core-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/Toflar/core-bundle/languages","stargazers_url":"https://api.github.com/repos/Toflar/core-bundle/stargazers","contributors_url":"https://api.github.com/repos/Toflar/core-bundle/contributors","subscribers_url":"https://api.github.com/repos/Toflar/core-bundle/subscribers","subscription_url":"https://api.github.com/repos/Toflar/core-bundle/subscription","commits_url":"https://api.github.com/repos/Toflar/core-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Toflar/core-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Toflar/core-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Toflar/core-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Toflar/core-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/Toflar/core-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Toflar/core-bundle/merges","archive_url":"https://api.github.com/repos/Toflar/core-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Toflar/core-bundle/downloads","issues_url":"https://api.github.com/repos/Toflar/core-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/Toflar/core-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/Toflar/core-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/Toflar/core-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Toflar/core-bundle/labels{/name}","releases_url":"https://api.github.com/repos/Toflar/core-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/Toflar/core-bundle/deployments","created_at":"2014-11-14T14:32:10Z","updated_at":"2015-04-18T14:10:14Z","pushed_at":"2016-08-08T20:40:41Z","git_url":"git://github.com/Toflar/core-bundle.git","ssh_url":"git@github.com:Toflar/core-bundle.git","clone_url":"https://github.com/Toflar/core-bundle.git","svn_url":"https://github.com/Toflar/core-bundle","homepage":"","size":28001,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"contao:master","ref":"master","sha":"ab28353618bde53eacc10b477f8bccaee50850ba","user":{"login":"contao","id":1206136,"avatar_url":"https://avatars.githubusercontent.com/u/1206136?v=3","gravatar_id":"","url":"https://api.github.com/users/contao","html_url":"https://github.com/contao","followers_url":"https://api.github.com/users/contao/followers","following_url":"https://api.github.com/users/contao/following{/other_user}","gists_url":"https://api.github.com/users/contao/gists{/gist_id}","starred_url":"https://api.github.com/users/contao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contao/subscriptions","organizations_url":"https://api.github.com/users/contao/orgs","repos_url":"https://api.github.com/users/contao/repos","events_url":"https://api.github.com/users/contao/events{/privacy}","received_events_url":"https://api.github.com/users/contao/received_events","type":"Organization","site_admin":false},"repo":{"id":20519851,"name":"core-bundle","full_name":"contao/core-bundle","owner":{"login":"contao","id":1206136,"avatar_url":"https://avatars.githubusercontent.com/u/1206136?v=3","gravatar_id":"","url":"https://api.github.com/users/contao","html_url":"https://github.com/contao","followers_url":"https://api.github.com/users/contao/followers","following_url":"https://api.github.com/users/contao/following{/other_user}","gists_url":"https://api.github.com/users/contao/gists{/gist_id}","starred_url":"https://api.github.com/users/contao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contao/subscriptions","organizations_url":"https://api.github.com/users/contao/orgs","repos_url":"https://api.github.com/users/contao/repos","events_url":"https://api.github.com/users/contao/events{/privacy}","received_events_url":"https://api.github.com/users/contao/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/contao/core-bundle","description":"Contao 4 core bundle","fork":false,"url":"https://api.github.com/repos/contao/core-bundle","forks_url":"https://api.github.com/repos/contao/core-bundle/forks","keys_url":"https://api.github.com/repos/contao/core-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/contao/core-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/contao/core-bundle/teams","hooks_url":"https://api.github.com/repos/contao/core-bundle/hooks","issue_events_url":"https://api.github.com/repos/contao/core-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/contao/core-bundle/events","assignees_url":"https://api.github.com/repos/contao/core-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/contao/core-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/contao/core-bundle/tags","blobs_url":"https://api.github.com/repos/contao/core-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/contao/core-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/contao/core-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/contao/core-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/contao/core-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/contao/core-bundle/languages","stargazers_url":"https://api.github.com/repos/contao/core-bundle/stargazers","contributors_url":"https://api.github.com/repos/contao/core-bundle/contributors","subscribers_url":"https://api.github.com/repos/contao/core-bundle/subscribers","subscription_url":"https://api.github.com/repos/contao/core-bundle/subscription","commits_url":"https://api.github.com/repos/contao/core-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/contao/core-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/contao/core-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/contao/core-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/contao/core-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/contao/core-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/contao/core-bundle/merges","archive_url":"https://api.github.com/repos/contao/core-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/contao/core-bundle/downloads","issues_url":"https://api.github.com/repos/contao/core-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/contao/core-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/contao/core-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/contao/core-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/contao/core-bundle/labels{/name}","releases_url":"https://api.github.com/repos/contao/core-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/contao/core-bundle/deployments","created_at":"2014-06-05T09:45:55Z","updated_at":"2016-06-14T14:23:35Z","pushed_at":"2016-08-09T14:49:18Z","git_url":"git://github.com/contao/core-bundle.git","ssh_url":"git@github.com:contao/core-bundle.git","clone_url":"https://github.com/contao/core-bundle.git","svn_url":"https://github.com/contao/core-bundle","homepage":"","size":31263,"stargazers_count":39,"watchers_count":39,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":35,"forks":18,"open_issues":35,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/562"},"html":{"href":"https://github.com/contao/core-bundle/pull/562"},"issue":{"href":"https://api.github.com/repos/contao/core-bundle/issues/562"},"comments":{"href":"https://api.github.com/repos/contao/core-bundle/issues/562/comments"},"review_comments":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/562/comments"},"review_comment":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/562/commits"},"statuses":{"href":"https://api.github.com/repos/contao/core-bundle/statuses/e5cd8efde8cc403cf91e1b106e5ff6ca316e8a17"}}}}
{"actor":{"display_login":"Toflar"}}