Fast Websites

Евгений Лейченок, 21 мая 2013

Fast Websites

Евгений Лейченок, 21 мая 2013

Задача

  1. Пользователь должен тратить меньше времени на ожидание, чем сейчас

А зачем это нужно?

  1. Чем быстрее пользователь начнёт работу - тем лучше

http://www.gomez.com/pdfs/wp_why_web_performance_matters.pdf

А чем мы можем помочь?

80-90% of the end-user response time is spent on the frontend. Start there.

Steve Souders, http://www.stevesouders.com/blog/2012/02/10/the-performance-golden-rule/

А что почитать?

14 правил от Steve Souders

http://stevesouders.com/hpws/rules.php

14 правил от Steve Souders...

  1. Make Fewer HTTP Requests
  2. Use a Content Delivery Network
  3. Add an Expires Header
  4. Gzip Components
  5. Put Stylesheets at the Top
  6. Put Scripts at the Bottom
  7. Avoid CSS Expressions

...14 правил от Steve Souders

  1. Make JavaScript and CSS External
  2. Reduce DNS Lookups
  3. Minify JavaScript
  4. Avoid Redirects
  5. Remove Duplicated Scripts
  6. Configure ETags
  7. Make AJAX Cacheable

Сжимаем JavaScript

jQuery 1.9.1 - 240KB -> 91KB -> 33KB

Сжимаем CSS

Twitter Bootstrap 2.3.2 - 124KB -> 104KB -> 23KB

Сжимаем графику

Сжимаем HTML

Сжимаем шрифты

Komika Hand (ttf) - 54KB -> 10KB (10 символов)

Сжали. Что дальше?

Инструменты

PageSpeed

YSlow

Online-инструменты

HTTP Archive

Спасибо!