{"action":"created","issue":{"url":"https://api.github.com/repos/apotonick/cells/issues/401","repository_url":"https://api.github.com/repos/apotonick/cells","labels_url":"https://api.github.com/repos/apotonick/cells/issues/401/labels{/name}","comments_url":"https://api.github.com/repos/apotonick/cells/issues/401/comments","events_url":"https://api.github.com/repos/apotonick/cells/issues/401/events","html_url":"https://github.com/apotonick/cells/issues/401","id":155216098,"number":401,"title":"several cache-related questions","user":{"login":"dreyks","id":1481264,"avatar_url":"https://avatars.githubusercontent.com/u/1481264?v=3","gravatar_id":"","url":"https://api.github.com/users/dreyks","html_url":"https://github.com/dreyks","followers_url":"https://api.github.com/users/dreyks/followers","following_url":"https://api.github.com/users/dreyks/following{/other_user}","gists_url":"https://api.github.com/users/dreyks/gists{/gist_id}","starred_url":"https://api.github.com/users/dreyks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreyks/subscriptions","organizations_url":"https://api.github.com/users/dreyks/orgs","repos_url":"https://api.github.com/users/dreyks/repos","events_url":"https://api.github.com/users/dreyks/events{/privacy}","received_events_url":"https://api.github.com/users/dreyks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-17T09:36:19Z","updated_at":"2016-05-17T11:17:40Z","closed_at":null,"body":"1. It seems that cache does not take into consideration neither template not cell code change. Rails does template digesting to combat this\r\n2. Say I want only a part of cell template cached: common use-case is \"cached html with uncached js\". What is the best way to achieve this?\r\n\r\nCurrently I've come up with something like this\r\n\r\n```ruby\r\nclass MyCell < Cell::ViewModel\r\n  cache :html { 'my_cache_key' }\r\n\r\n  def show\r\n    call(:html) + render(:js)\r\n  end\r\n\r\n  def html\r\n    render :show\r\n  end\r\nend\r\n```\r\n\r\nAnd then I have `show.erb` which has all the html (and this state is cached), and (uncached) `js.erb` that has all the access to cell instance variables\r\n\r\nWhat d'you think?\r\n\r\nBtw, for some weird reason I have to write `call(:html) + render(:js).html_safe`, otherwise the js template gets escaped"},"comment":{"url":"https://api.github.com/repos/apotonick/cells/issues/comments/219688934","html_url":"https://github.com/apotonick/cells/issues/401#issuecomment-219688934","issue_url":"https://api.github.com/repos/apotonick/cells/issues/401","id":219688934,"user":{"login":"dreyks","id":1481264,"avatar_url":"https://avatars.githubusercontent.com/u/1481264?v=3","gravatar_id":"","url":"https://api.github.com/users/dreyks","html_url":"https://github.com/dreyks","followers_url":"https://api.github.com/users/dreyks/followers","following_url":"https://api.github.com/users/dreyks/following{/other_user}","gists_url":"https://api.github.com/users/dreyks/gists{/gist_id}","starred_url":"https://api.github.com/users/dreyks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreyks/subscriptions","organizations_url":"https://api.github.com/users/dreyks/orgs","repos_url":"https://api.github.com/users/dreyks/repos","events_url":"https://api.github.com/users/dreyks/events{/privacy}","received_events_url":"https://api.github.com/users/dreyks/received_events","type":"User","site_admin":false},"created_at":"2016-05-17T11:17:40Z","updated_at":"2016-05-17T11:17:40Z","body":"Yeah, that's what I thought too, but then again, someone can do\r\n```ruby\r\ndef show\r\n  render :surprise\r\nend\r\n```\r\nand how will we know that... \r\n\r\nHow do I find the chat-room in gitter?"}}