I have an app on which I greatly improved the response times by making use of caching.
I'm Russian doll caching fragments, and one fragment renders a couple of (nested) partials. Everything seems to be working like it should, but some of my included partials are made out of an interpolated string. For those partials, I get a caching error in my error log:
Couldn't find template for digesting: path/to/#{my.calculated.partial.name}
I've spent some time on Google, and the only thing I find is that a lot of people want to have the digesting switched off. So I've basically got a couple of questions:
Is there a way to fix this particular issue? (i.e. having cache digests for the actual "evaluated" partial names)?
- I can imagine the answer to this to be "no", since the cached version of a page isn't executing any code, and as such, interpolated strings can't
More general: why would I want to enable or disable cache digests? What's their purpose?
How would you suggest I work around these errors (if not solved by 1.)?
Update:
As requested, an example of a view that gives me this error would be:
-cache ['survey', @survey], expires_in: expire_period
[...]
-cache ['survey_questions', @survey]
-@survey.questions.each do |q|
=render "field_types/#{q.field_type.type.underscore}", question: q, f: f
For instance when a field type is 'text input', it renders field_types/_text_input.html.haml. This all works great. The error I would get in my log is then:
_Couldn't find template for digesting: field_types/field_types/#{q.field_type.type.underscore}_