liquid-rails icon indicating copy to clipboard operation
liquid-rails copied to clipboard

cacheable? false

Open gja opened this issue 8 years ago • 0 comments

I notice that the rails templates are not cacheable. This makes the template get re-read from disk, then parsed every time the view is rendered, which is slow.

I understand that rails template compilable implies you are returning the function as source code (which is unacceptable), but I was wondering if it made sense to memoize the "parse" function, so that it returns the same template?

The render-ing function would have to be a pure function. Thus, I think, you'd have to use the render! function, as the render mutates the templates with errors.

gja avatar May 09 '16 05:05 gja