{"action":"created","issue":{"url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1413","labels_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1413/labels{/name}","comments_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1413/comments","events_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1413/events","html_url":"https://github.com/backdrop/backdrop-issues/issues/1413","id":122299022,"number":1413,"title":"Performance improvement:  render cache.","user":{"login":"Gormartsen","id":5018896,"avatar_url":"https://avatars.githubusercontent.com/u/5018896?v=3","gravatar_id":"","url":"https://api.github.com/users/Gormartsen","html_url":"https://github.com/Gormartsen","followers_url":"https://api.github.com/users/Gormartsen/followers","following_url":"https://api.github.com/users/Gormartsen/following{/other_user}","gists_url":"https://api.github.com/users/Gormartsen/gists{/gist_id}","starred_url":"https://api.github.com/users/Gormartsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gormartsen/subscriptions","organizations_url":"https://api.github.com/users/Gormartsen/orgs","repos_url":"https://api.github.com/users/Gormartsen/repos","events_url":"https://api.github.com/users/Gormartsen/events{/privacy}","received_events_url":"https://api.github.com/users/Gormartsen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":34,"created_at":"2015-12-15T15:38:14Z","updated_at":"2015-12-17T22:32:02Z","closed_at":null,"body":"_I promised to improve BD performance by introducing render cache around 1 month ago._\r\n\r\nFinally first stable release is ready. Sometimes it boost BD **twice**.\r\nYou can see code changes [here](https://github.com/Gormartsen/backdrop/compare/5f5b590e5bc529c25264b3d1430d0cd2c5627ce4...Gormartsen:1.x)\r\n\r\n\r\nYou can test it here:\r\nhttp://bd1.backdrop.expert (render cache **enabled**)\r\nhttp://bd2.backdrop.expert  (render cache **disabled**)\r\n\r\nData generated by level module. Devel data available for authorized and anonymous users at the end of the page.\r\n\r\nLogin: admin\r\nPass: admin123\r\n\r\nSettings for render cache is here:\r\nhttp://bd1.backdrop.expert/admin/config/development/performance\r\n\r\nSection: Render boost\r\n\r\nThere is to cache methods:\r\ndatabase - store in cache_render table \r\nfile - store in public://render_cache folder \r\n\r\nFile cache is better for system with op cache enabled, because generated cache file is static php files that could be stored in memory by op cache.\r\n\r\nTry both.\r\n\r\nTemporary I wrapped cached data into: <cached id=\"md5\"> </cached> for testing purposes.\r\n\r\nRender cache is not sensitive to user credential and do not cache forms for now.\r\n\r\nTesting and feedback is required here.\r\n\r\nAlso I am hoping that we can include it into 1.3.x release next January.\r\n\r\n_With love from Canada_"},"comment":{"url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/comments/165603219","html_url":"https://github.com/backdrop/backdrop-issues/issues/1413#issuecomment-165603219","issue_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/1413","id":165603219,"user":{"login":"Gormartsen","id":5018896,"avatar_url":"https://avatars.githubusercontent.com/u/5018896?v=3","gravatar_id":"","url":"https://api.github.com/users/Gormartsen","html_url":"https://github.com/Gormartsen","followers_url":"https://api.github.com/users/Gormartsen/followers","following_url":"https://api.github.com/users/Gormartsen/following{/other_user}","gists_url":"https://api.github.com/users/Gormartsen/gists{/gist_id}","starred_url":"https://api.github.com/users/Gormartsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gormartsen/subscriptions","organizations_url":"https://api.github.com/users/Gormartsen/orgs","repos_url":"https://api.github.com/users/Gormartsen/repos","events_url":"https://api.github.com/users/Gormartsen/events{/privacy}","received_events_url":"https://api.github.com/users/Gormartsen/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T22:32:02Z","updated_at":"2015-12-17T22:32:02Z","body":"It's actually easy to do even now.\r\n\r\n```php\r\n\r\nfunction backdrop_asset_record($method = 'start'){\r\n  static $stored\r\n  if($method == \"start\"){\r\n    $current_css = backdrop_add_css();\r\n  }else{\r\n    $updates_css = backdrop_add_css();\r\n    return array_diff($updates_css, $current_css);\r\n  }\r\n}\r\n\r\nbackdrop_asset_record('start');\r\n$html = backdrop_render($renderable_array);\r\n$assets = backdrop_asset_record('stop');\r\nprint_r($assets);\r\n\r\n```"}}