Ruby on rails 如何在redis缓存rails中保存html
我想在redis缓存rails中保存htmlRuby on rails 如何在redis缓存rails中保存html,ruby-on-rails,ruby,caching,redis,Ruby On Rails,Ruby,Caching,Redis,我想在redis缓存rails中保存html def cache(cache_name) Rails.cache.fetch(cache_name, expires_in: 5.minutes){ yield } end 鉴于 <% cache("key") do %> <h1>Header</h1> <%end%> 标题 因为html在保存后不呈现,所以我的更新解决方案无法工作?否:(………您更改了帮助者的名称?它在我的机器上工作
def cache(cache_name)
Rails.cache.fetch(cache_name, expires_in: 5.minutes){ yield }
end
鉴于
<% cache("key") do %>
<h1>Header</h1>
<%end%>
标题
因为html在保存后不呈现,所以我的更新解决方案无法工作?否:(………您更改了帮助者的名称?它在我的机器上工作..您是否先清除了缓存?
Rails.cache.clear
?您是如何做到的?在控制台中键入Rails.cache.clear
,然后按enter键