Web Performance Optimization com ASP.NET Core

16
Web Performance Optimization com ASP.NET Core @RodolfoFadino

Transcript of Web Performance Optimization com ASP.NET Core

Web Performance Optimizationcom ASP.NET Core

@RodolfoFadino

! Instantâneo

Soma de fatores

Back-End

• Cache

• Thread

• Debug/Release

• SQL

• IO

• Network

• ...

Front-End

• CSS

• JS

• IMG

• Headers

• Minified

• CDN

• Proxy

• Cookies

• ...

Vamos fazer um projeto para isso

Backlog

Melhorar a performance é uma responsabilidade nossa

(desenvolvedor)

“…only 10-20% of the total end-user response time is spent getting the HTML document to the browser. You need to focus on the other 80-90% if you want to make your pages noticeably faster…” (Steve Souders)

14 regras

Rule 1 - Make Fewer HTTP RequestsRule 2 - Use a Content Delivery NetworkRule 3 - Add an Expires HeaderRule 4 - Gzip ComponentsRule 5 - Put Stylesheets at the TopRule 6 - Put Scripts at the BottomRule 7 - Avoid CSS ExpressionsRule 8 - Make JavaScript and CSS ExternalRule 9 - Reduce DNS LookupsRule 10 - Minify JavaScriptRule 11 - Avoid RedirectsRule 12 - Remove Duplicate ScriptsRule 13 - Configure ETagsRule 14 - Make AJAX Cacheable

Anatomia de uma requisição HTTP

• DNS Lookup

• Initial Connection

– Keep-Alive Header

• Time to First Byte

• Content Download

CSS e JS

CSS

– Header

JS

– Assíncrono

– Mais próximo do final

Bundling

Minification

Static Files

Expires

Handler

Imagens físicas

Lazy Load

Dependendo do cenário

Sprites

Otimizar

RIOT

Obrigado

• @rodolfofadino

• http://rodolfofadino.com.br