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
%>