【发布时间】:2013-02-23 00:52:25
【问题描述】:
我们有一个 rails 3 应用程序 (3.2.12),我们希望在其上实现全页缓存(使用 ActionController caches_page)
我们在应用程序的任何地方都使用_url url 助手,这导致所有缓存页面(生产中)中的链接都具有域:http://0.0.0.0/
我们在几个需要链接域的页面上有规范链接,因此我们无法轻松切换到_path url 助手。
我搜索了 Google 和 StackOverflow,但找不到答案。
我没有将任何选项传递给caches_page
页面基本上是这样的:
class SomeController < ApplicationController
caches_page :index, :other_action
def index
end
def other_action
end
end
如何使生成的缓存页面中的链接具有正确的域?
【问题讨论】:
-
您使用的是什么网络服务器?您将哪些选项传递给 cache_page?查看代码会有所帮助。
-
@BenjaminSullivan 我们正在运行 Apache 的 Phusion Passenger。我没有将任何选项传递给
caches_page
标签: ruby-on-rails ruby-on-rails-3 caching actioncontroller