http://blog.hendrikvolkmer.de/2007/3/8/http-referer-and-redirect_to-back
[config/environments/development.rb]
config.action_controller.consider_all_requests_local = false
# force the request connect from outside
def local_request?
false
end
#有上面兩個條件rescue_action_in_public才可以在local測
def rescue_action_in_public(exception)
case exception
when ActionController::RoutingError
redirect_to home_url
else
super
end
end
<%= stylesheet_link_tag "defaults", "paginator", :cache => 'css_cache' %>
<%= javascript_include_tag "jquery", "jquery.corner.js", "jquerypngfix.js", :cache => 'js_cache' %>
上述的這些 :cache 功能 如果 client ip 是從 local來 就不會跑, 不會生出 css_cache.css 或 js_cache.js
沒有留言:
張貼留言