Weitere ähnliche Inhalte Ähnlich wie Client Side Measurement & Performance With Rails (20) Kürzlich hochgeladen (20) Client Side Measurement & Performance With Rails2. The Performance
Golden Rule
“Only 10-20% of the end user response time
is spent downloading the HTML document.
The other 80-90% is spent downloading all
the components in the page”
-- Steve Souders 7. Make Less HTTP Requests
Less requests, less HTTP overhead
Combine components wherever possible: 8. Gzip Components
http {
...
gzip on;
gzip_min_length 1100;
gzip_types text/plain text/html application/x-javascript text/css
application/atom+xml text/xml text/js text/javascript;
...
}
Huge reduction in response size (~70%) 9. Add an expires header
Eliminates 304 Not Modified Requests
Rails helps...
...but you need to add this:
server {
...
root /home/uberhour/uberhour/current/public;
location ~ ^/(images|javascripts|stylesheets)/ {
root /home/uberhour/uberhour/current/public;
expires 365d;
}
...
} 10. Put Stylesheets at the Top
Allows the browser to start rendering the page
as content is downloaded
Everybody already does this....moving along! 11. Scripts at the Bottom
Scripts are downloaded and block the rest of the
component requests while they are being loaded
in the layout:
in the view: