目前,请求需要很长时间。我得到的日志是
Completed 200 OK in 22365ms (Views: 17995.5ms | ActiveRecord: 1280.4ms)
这是一个iOS rails应用程序,实际上没有生成视图。有没有办法减少在iOS rails应用程序中渲染视图所需的时间?
答案 0 :(得分:1)
有多种方法可以缩短请求时间:
1) Minimize HTTP Requests
2) Use a Content Delivery Network
3) Avoid empty src or href
4) Add an Expires or a Cache-Control Header
5) Gzip Components
6) Put StyleSheets at the Top
7) Put Scripts at the Bottom
8) Avoid CSS Expressions
9) Make JavaScript and CSS External
10) Reduce DNS Lookups
11) Minify JavaScript and CSS
12) Avoid Redirects
13) Remove Duplicate Scripts
14) Configure ETags
15) Make AJAX Cacheable
16) Use GET for AJAX Requests
17) Reduce the Number of DOM Elements
18) No 404s
19) Reduce Cookie Size
20) Do Not Scale Images in HTML
21) Make favicon.ico Small and Cacheable
您可以更详细地阅读所有这些http://yslow.org/