Learn how to develop web applications that deploy cross-platform and are optimized for high performance using ASP.NET Core 2 About This Book Master high-level web app performance improvement techniques using ASP.NET Core 2.0 Find the right balance between premature optimization and inefficient code Design workflows that run asynchronously and are resilient to transient performance issues Who This Book Is For This book is aimed for readers who can build a web application and have some experience with ASP.NET or some other web application framework (such as Ruby on Rails or Django). They can be people who are happy learning details independently but who struggle to discover the topics that they should be researching. The reader should be interested in improving the performance of their web app and in learning about ASP.NET Core and modern C#. What You Will Learn Understand ASP.NET Core 2 and how it differs from its predecessor Address performance issues at the early stages of development Set up development environments on Windows, Mac, and Linux Measure, profile and find the most significant problems Identify the differences between development workstations and production infrastructures, and how these can exacerbate problems Boost the performance of your application but with an eye to how it affects complexity and maintenance Explore a few cutting-edge techniques such as advanced hashing and custom transports In Detail The ASP.NET Core 2 framework is used to develop high-performance and cross-platform web applications. It is built on .NET Core 2 and includes significantly more framework APIs than version 1. This book addresses high-level performance improvement techniques. It starts by showing you how to locate and measure problems and then shows you how to solve some of the most common ones. Next, it shows you how to get started with ASP.NET Core 2 on Windows, Mac, Linux, and with Docker containers. The book illustrates what problems can occur as latency increases when deploying to a cloud infrastructure. It also shows you how to optimize C# code and choose the best data structures for the job. It covers new features in C# 6 and 7, along with parallel programming and distributed architectures. By the end of this book, you will be fixing latency issues and optimizing performance problems, but you will also know how this affects the complexity and maintenance of your application. Finally, we will explore a few highly advanced techniques for further optimization. Style and Approach A step-by-step practical guide filled with real-world use cases and examples ""Cover"" ""Title Page"" ""Copyright"" ""Credits"" ""Foreword"" ""About the Author"" ""About the Reviewer"" ""www.PacktPub.com"" ""Customer Feedback"" ""Table of Contents"" ""Preface"" ""Chapter 1: What's New in ASP.NET Core 2?"" ""What's new in Core 2"" ""What's new in .NET Core 2"" ""Performance improvements"" ""What's new in ASP.NET Core 2"" ""Performance improvements"" ""Standards"" ""New C# features"" ""C# 6"" ""String interpolation"" ""Null conditional"" ""Exception filters"" ""Asynchronous availability"" ""Expression bodies"" ""C# 7"" ""Literals"" ""Tuples"" ""Out variables""""References"" ""Patterns"" ""More expression bodies"" ""More asynchronous improvements"" ""JavaScript"" ""Summary"" ""Chapter 2: Why Performance Is a Feature"" ""Performance as a feature"" ""Common classes of performance problems"" ""Language considerations"" ""Types of performance problems"" ""When performance matters"" ""Slower is sometimes better"" ""Why issues are missed"" ""Measuring"" ""The benefits of planning ahead"" ""Understanding hardware"" ""Storage access speeds"" ""Scaling approach changes"" ""Tools and costs"" ""Tools"" ""Looking at some alternative tools""""The new .NET"" ""Summary"" ""Chapter 3: Setting Up Your Environment"" ""Windows"" ""Visual Studio 2017"" ""Installing VS"" ""Installing .NET Core 2"" ""Creating your first app"" ""Mac"" ""Visual Studio for Mac"" ""Installing VS Mac"" ""Installing .NET Core 2"" ""Creating your first app"" ""Visual Studio Code"" ""Linux"" ""Getting started with .NET Core on Linux"" ""Installing .NET Core 2"" ""Creating your first app"" ""Containerization with Docker"" ""Using ASP.NET Core 2 with Docker"" ""Summary"" ""Chapter 4: Measuring Performance Bottlenecks""""Tools"" ""SQL"" ""SQL Server Profiler"" ""Executing a simple query"" ""MiniProfiler"" ""Application profiling"" ""Glimpse"" ""Using Glimpse"" ""IDE"" ""Monitoring HTTP"" ""Browsers"" ""Chrome"" ""Firefox"" ""Fiddler"" ""Network"" ""Microsoft Message Analyzer"" ""Wireshark"" ""Roll your own"" ""Science"" ""Repeatability"" ""Only change one thing"" ""Summary"" ""Chapter 5: Fixing Common Performance Problems"" ""Latency"" ""Asynchronous operations"" ""Simple asynchronous tools"" ""Background queuing"" ""Hangfire"" ""Select N+1 problems""""Efficient paging"" ""Static site generators"" ""Pragmatic solutions with hardware"" ""A desktop example"" ""Web applications"" ""Oversized images"" ""Image resolution"" ""Image format"" ""Summary"" ""Chapter 6: Addressing Network Performance"" ""Internet protocols"" ""TCP/IP"" ""Slow-start"" ""HTTP"" ""Headers"" ""HTTP methods"" ""Status codes"" ""Encryption"" ""Key exchange"" ""Delay diagnostics"" ""Performance tweaks"" ""HTTP/2"" ""WebSockets"" ""Compression"" ""Lossless compression algorithms"" ""Bundling and minification"" ""Bundling"" This book targets web application developers who have some experience with ASP.NET MVC—or another web application framework (such as Ruby on Rails or Django)—and who are interested in gaining experience with ASP.NET Core and C#. They are happy learning independently but struggle to discover what topics they should be researching