You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Rails 4.0.2, and want to background rendering of objects for cache warming, prior to a Controller action ever being hit for certain APIs.
When rendering a template from a Controller action, I get the expected cache actions showing the below cache keys. In this case, the template's cache digest is d30440d18014c72014a05319af0626f7
I realize this is a scoping issue, but its not clear what the scope should be in the cache warming use case. Passing self be it the Model, Observer, or some Helper class doesn't provide the scope necessary for the template digest to be appended to the cache_key. When passing the Controller through this does work as expected, but this is not available during the attempt to warm the cache through a background process. Maybe this approach is totally incorrect?
The text was updated successfully, but these errors were encountered:
I could not find a solution with Rabl::Render to warm a cache, but am able to use this method as a background process effectively. I think this is a bit too heavy, and still think there is a more elegant solution out there with Rabl::Render.
I'm running into the same issue here. Rails haml has the ability to skip_digest, and I think the same option should be available for RABL caching as well.
I'm using Rails 4.0.2, and want to background rendering of objects for cache warming, prior to a Controller action ever being hit for certain APIs.
When rendering a template from a Controller action, I get the expected cache actions showing the below cache keys. In this case, the template's cache digest is d30440d18014c72014a05319af0626f7
When calling Rabl::Render out of the Controller's scope I get a different cache_key, basically without the temaplte digest appended to the end.
I realize this is a scoping issue, but its not clear what the scope should be in the cache warming use case. Passing
self
be it the Model, Observer, or some Helper class doesn't provide the scope necessary for the template digest to be appended to the cache_key. When passing the Controller through this does work as expected, but this is not available during the attempt to warm the cache through a background process. Maybe this approach is totally incorrect?The text was updated successfully, but these errors were encountered: