Rails.cache.fetch("#{last_update}/all_pages_cached") do
hash
end
@comment_cnt = Comment.where(post_id: @category.post_ids)).group(:post_id).count
@comment_last = Comment.where(post_id: @category.post_ids).group(:post_id).having('id = MAX(id)')
Rails.cache.fetch("products", :expires_in => 10.minutes) do
....
end