{"action":"created","issue":{"url":"https://api.github.com/repos/comfy/comfortable-mexican-sofa/issues/678","labels_url":"https://api.github.com/repos/comfy/comfortable-mexican-sofa/issues/678/labels{/name}","comments_url":"https://api.github.com/repos/comfy/comfortable-mexican-sofa/issues/678/comments","events_url":"https://api.github.com/repos/comfy/comfortable-mexican-sofa/issues/678/events","html_url":"https://github.com/comfy/comfortable-mexican-sofa/issues/678","id":100019110,"number":678,"title":"Hefty speed-problem with `cms_block_content`?","user":{"login":"toadle","id":115103,"avatar_url":"https://avatars.githubusercontent.com/u/115103?v=3","gravatar_id":"","url":"https://api.github.com/users/toadle","html_url":"https://github.com/toadle","followers_url":"https://api.github.com/users/toadle/followers","following_url":"https://api.github.com/users/toadle/following{/other_user}","gists_url":"https://api.github.com/users/toadle/gists{/gist_id}","starred_url":"https://api.github.com/users/toadle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toadle/subscriptions","organizations_url":"https://api.github.com/users/toadle/orgs","repos_url":"https://api.github.com/users/toadle/repos","events_url":"https://api.github.com/users/toadle/events{/privacy}","received_events_url":"https://api.github.com/users/toadle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-10T09:35:23Z","updated_at":"2015-08-24T15:35:51Z","closed_at":null,"body":"Hey guys, \r\n\r\nI don't know if it is just me, but I noticed a quite hefty speed problem on our page. We rely quite heavy on custom-cms-fields/blocks that decide if some element is displayed or not. Like so: \r\n\r\n`if cms_block_content(:\"txtblock.display\") == \"1\"`\r\n\r\nNow when trying to track down the speed problem, I noticed this line in `cms_block_content`: \r\n\r\n```\r\n  def tag\r\n    @tag ||= blockable.tags(:reload).detect { |t| t.is_cms_block? && t.identifier == identifier }\r\n  end\r\n```\r\n\r\nI monkey-patched it to:\r\n\r\n```\r\n  def tag\r\n    @tag ||= blockable.tags.detect { |t| t.is_cms_block? && t.identifier == identifier }\r\n  end\r\n```\r\n\r\nAnd got a quite significant speed increase: The page loaded in 900ms instead of 2.5s\r\nBut I also got problems with the content being loaded. So it seems this \"reload\" is essential. \r\n\r\nI don't really get, what it does. \r\n\r\nAny explanation? Any idea to make it fast again?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/comfy/comfortable-mexican-sofa/issues/comments/134254215","html_url":"https://github.com/comfy/comfortable-mexican-sofa/issues/678#issuecomment-134254215","issue_url":"https://api.github.com/repos/comfy/comfortable-mexican-sofa/issues/678","id":134254215,"user":{"login":"toadle","id":115103,"avatar_url":"https://avatars.githubusercontent.com/u/115103?v=3","gravatar_id":"","url":"https://api.github.com/users/toadle","html_url":"https://github.com/toadle","followers_url":"https://api.github.com/users/toadle/followers","following_url":"https://api.github.com/users/toadle/following{/other_user}","gists_url":"https://api.github.com/users/toadle/gists{/gist_id}","starred_url":"https://api.github.com/users/toadle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toadle/subscriptions","organizations_url":"https://api.github.com/users/toadle/orgs","repos_url":"https://api.github.com/users/toadle/repos","events_url":"https://api.github.com/users/toadle/events{/privacy}","received_events_url":"https://api.github.com/users/toadle/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T15:35:51Z","updated_at":"2015-08-24T15:35:51Z","body":"@wyaeld @GBH I my oppinion the default-behaviour should be moved back to something more speedy. Since the documentation advises to actually use `cms_block_content` and this thing gets slow very fast, I think the default should be like getting only text from the DB. \r\n\r\nIf people really want to use tags here, then the `cms_block_content` could offers something like `cms_block_content(tags: true)` where the caller is aware of the problem. \r\n\r\nWhy does this tags-behviour exist anyway? That is because I should be able to use something like `{{cms:helper:...}`, correct?"}}