我正在使用memcached来存储我较重的查询,但在尝试缓存Page模型的站点地图时遇到了障碍。
class Page < ActiveRecord::Base
acts_as_tree
end
示例:
page
-- child_page1
-- subchild_page1
-- subchild_page2
我对如何用Memcached存储它感到茫然。任何建议都会有很长的路要走!
Rails.cache.fetch("foo") do
# not sure how to store the pages. perhaps as a hash?
end