Building fast aspnet websites

15
Building fast ASP.NET websites Maarten Louage @maartenlouage

Transcript of Building fast aspnet websites

Page 1: Building fast aspnet websites

Building fast ASP.NET websites

Maarten Louage@maartenlouage

Page 2: Building fast aspnet websites

Maarten Louage

• @maartenlouage• [email protected]• https://github.com/mlouage

Page 3: Building fast aspnet websites

I will talk about

• how changing a few IIS settings…• how changing the layout of HTML, CSS and Javascript…• applying a few simple C# rules…

…can lead to an increase in performance

Page 4: Building fast aspnet websites

I will NOT talk about

• numbers, statistics, time to first byte, time to first paint, …

because we all know faster is better

Page 5: Building fast aspnet websites

My bible

Page 6: Building fast aspnet websites

Tools

• Chrome Developer Tools• YSlow• Google PageSpeed Insights• Fiddler

Page 7: Building fast aspnet websites

…and web.config• compression• gzip, deflate, SDCH

• caching• headers• static content• dynamic content• etags• content delivery network

https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching

Page 8: Building fast aspnet websites

OutputCache in EPiServer

…but hey I have visitor groups?!

Code.cs

Page 9: Building fast aspnet websites

This is why we remove etags

Page 10: Building fast aspnet websites

Content Delivery Network

Page 11: Building fast aspnet websites

HTML optimizations

• CSS and javascript execution blocks rendering• put CSS on top and javascript on the bottom

<script>

<script async>

<script defer>

Page 12: Building fast aspnet websites

• bundling and minification of course!

…no, we have something better now

Page 13: Building fast aspnet websites

and

• bower for client side packages• gulp for running javascript tasks

Page 14: Building fast aspnet websites

Other client side techniques

• image optimization is great for static content• favicon and apple-touch

• for dynamic content use a scheduled job

https://github.com/Geta/ImageOptimization

Page 15: Building fast aspnet websites

Questions