hypertemplate icon indicating copy to clipboard operation
hypertemplate copied to clipboard

Add a way to cache certain parts of a document

Open DefV opened this issue 12 years ago • 0 comments

I added a way to cache certain parts of a hypertemplate document. The syntax I have devised:

member(@item) do |member|
  member.cache("item_#{@item.id}") do |member|
    member.values do |val|
      val.slow @item.slow_method
    end
  end
end

It's a work in progress: the implementation is coupled to XML & JSON, and there are no tests. Just looking if there's interest in this, and if the approach I've taken is a good one. Any suggestions welcome. I'm using this in production with great results

DefV avatar Feb 11 '14 09:02 DefV