point – “premature optimization is the root of all evil” (Donald Knuth) – the law of the instrument: “Give a small boy a hammer, and he will find that everything he encounters needs pounding.” (Abraham Kaplan)
– Optimization may make your product and/or build system complex • e.g. JS/CSS Minification, CSS Image Sprites – Is it enough simple for long-life system? Tricky solution may make maintenance difficult.
guess, just measure and verify it. – Use objective evidence to evaluate your page. • When does DOMContentLoaded event fire? • When does load event fire? • Is there any other good objective evidences?
best practices – High Performance Web Sites (O'Reilly) – Even Faster Web Sites (O'Reilly) – High Performance JavaScript (O'Reilly) – Web Performance Best Practices – Yahoo!'s Exceptional Performance
still has requests and 304 response. – YSlow reported that static components has no far-future expiration date. • Browser should ask server that are there any updated resources or not. – Latency problem makes this problem severe.
header. – Reduced requests from 57 to 2 (HTML and Google Analytics). – Good improvement for high latency environment. ExpiresActive on ExpiresDefault "access plus 1 day"
Use browser cache? Clear cache Yes No F5 (reload) Yes Yes if result is 304 Enter at address bar No if cache isn't expired Yes • If you want to reproduce first access, you need to clear cache and cookie. • If you want to reproduce second access, you need to use not F5 but enter at address bar.