{"action":"closed","issue":{"url":"https://api.github.com/repos/twigphp/Twig/issues/1742","labels_url":"https://api.github.com/repos/twigphp/Twig/issues/1742/labels{/name}","comments_url":"https://api.github.com/repos/twigphp/Twig/issues/1742/comments","events_url":"https://api.github.com/repos/twigphp/Twig/issues/1742/events","html_url":"https://github.com/twigphp/Twig/issues/1742","id":96306859,"number":1742,"title":"share cache between templates with/without the profiler","user":{"login":"fruitl00p","id":1492861,"avatar_url":"https://avatars.githubusercontent.com/u/1492861?v=3","gravatar_id":"","url":"https://api.github.com/users/fruitl00p","html_url":"https://github.com/fruitl00p","followers_url":"https://api.github.com/users/fruitl00p/followers","following_url":"https://api.github.com/users/fruitl00p/following{/other_user}","gists_url":"https://api.github.com/users/fruitl00p/gists{/gist_id}","starred_url":"https://api.github.com/users/fruitl00p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fruitl00p/subscriptions","organizations_url":"https://api.github.com/users/fruitl00p/orgs","repos_url":"https://api.github.com/users/fruitl00p/repos","events_url":"https://api.github.com/users/fruitl00p/events{/privacy}","received_events_url":"https://api.github.com/users/fruitl00p/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-21T12:44:53Z","updated_at":"2015-09-12T12:42:48Z","closed_at":"2015-09-12T12:42:48Z","body":"Currently the cached Twig templates that had the profiler enabled cannot be used when the profiler is _not_ enabled. Is there any plan / idea (or reasoning) behind the fact that the template cache cannot be shared between the two environments?\r\n\r\nThe main difference between the internal cache is:\r\n```php\r\nprotected function doDisplay(array $context, array $blocks = array())\r\n{\r\n    $__internal_some_random_hash = $this->env->getExtension(\"profiler\");\r\n    __internal_some_random_hash->enter($__internal_some_random_hash_prof = new Twig_Profiler_Profile($this->getTemplateName(), \"template\", \"some_template.twig\"));\r\n    // ...the actual parsed template\r\n    $__internal_some_random_hash->leave($__internal_some_random_hash_prof);\r\n    }\r\n```\r\nand ofcourse the ```getDebugInfo()``` is different ;)\r\n\r\nIn our situation we utilize various on demand profiling and by reusing the cache seems logical doesnt it? Whats the idea behind this?\r\n"}}