`
johnnyhg
  • 浏览: 348092 次
  • 来自: NA
社区版块
存档分类
最新评论

rails缓存Tips: 缓存js,css文件

阅读更多

4.缓存Tips: 缓存js,css文件

请参考: http://railslab.newrelic.com/2009/01/22/page-responsiveness

# Combining all your javascripts in production mode
<%= javascript_include_tag :all , :cache => true %>
<%= javascript_include_tag :all , :cache => "main" %>
<%= javascript_include_tag "product" , "cart" , "checkout" , :cache => "shop" %>
# Same sort of stuff with stylesheets
<%= stylesheet_link_tag :all , :cache => true %>
# Declaring an asset host
ActionController::Base.asset_host = "assets.example.com"
# What uses the asset host url
<%= image_tag 'title.gif' %>
<%= javascript_include_tag :all %>
<%= stylesheet_link_tag :all %>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics