A complete look into the bundling and minification framework available in the ASP.NET web optimization library. Learn how to efficiently optimize your website resources and assets without comprising the way you want to develop. ASP.NET makes bundling and minification incredibly easy and leaves no reason not to ensure your web application is fully optimized.
A complete look into the bundling and minification framework available in the ASP.NET web optimization library. Learn how to efficiently optimize your website resources and assets without comprising the way you want to develop. ASP.NET makes bundling and minification incredibly easy and leaves no reason not to ensure your web application is fully optimized. Walk through basic optimization setup against a demo application in both Web Forms and MVC. Then, work to enhance the demo application by adapting the bundling framework for ignoring files, ordering files, and adding CDN scripts with a fallback. You will see how to begin extending the optimization library with your own custom transforms to harness great flexibility. We will take customizations a step further and consider using custom bundles to consolidate and inject resources, enumerations and templates to the client. Finally, we will dive into unit testing your optimization configurations and extensions and the importance of doing so in a team environment.
Section Introduction Transcripts
Section Introduction Transcripts
Basic Optimizations Hi, and welcome to this module on basic optimizations in the ASP. net web optimization library. We're going to look at all the basic information required to set up some standard optimizations around the bundling and minifying inside an ASP. net application. By the end of this module, you should be able to easily add bundling and minification optimizations into your own web application with relative ease. We're going to start off by simply reviewing some of the default templates that can be found in Visual Studio 2012 when creating a new MVC web application. Each one of the templates is slightly unique and offer excellent starting points for bundling and minification. Then, we will introduce a common application, which we will be working with throughout this and subsequent modules of this course as we slowly transform it and use it as our testing ground for demos with the system. web. optimization framework. Inside of our demo bookstore application, we will look at simple bundle declarations and consumption. We will examine the differences between consumption from an MVC versus a web forms application. We will also look at the internal workings of the framework and exactly how requests get action and return the results. Finally, we will review how cache busting is automatically handled by the framework through the use of versioning and how you can take advantage of that out-of-the-box.
Advanced Optimizations Hi, and welcome to this module on Advanced Optimizations in the ASP. NET Web Optimization Library. This module will focus on more advanced, out-of-the-box functionality that you can use with the Optimization Library to get maximum efficiency with very little code. The features of the Optimization Library that we will review include - ignoring of certain files when optimizations are enabled or disabled, how certain file extension replacements are customized, alongside more details in the wild card character and version moniker that we have already seen used. You can also specify your own custom file orders for your application, but if you don't, there are certain defaults already in place you need to be aware of. Content Delivery Networks are often an overlooked consideration for many people, but is very easy to integrate with your bundles. However, what are the real benefits of using a CDN in your application? And finally, we'll take a look at the new bundle child class that offers a lot more than convenience for Dynamic Folder Bundling.
Extending Optimizations Hi, and welcome to this module on Extending Optimizations in the ASP. NET Web Optimization Library. While much of the module is based on the API given to us by the library, now we can take some time to talk about how you can write custom code to extend the library. I think you'll find that it opens up a complete new set of ideas that you can utilize the Optimization Library for. By the end of this module, you should be able to easily extend the library by writing powerful custom transformations. We will start it off by discussing how you can create your own Custom Convenience Bundles, like the Script and StyleBundle classes we've already seen. Then we'll spend some time looking at Custom Transformations, which is where the real power of the library lives. We'll then use Custom Transformations and look at how intermediate languages could be integrated using Pre-Processor Transforms for libraries like CoffeeScript and LESS. CSS URL Rewriting is something to be careful of in the out-of-the-box defaults, but we can eliminate that risk pretty easily. And finally, we'll take a look at bootstrapping our custom optimizations by incorporating the Bundle Transformer NuGet Package.
Testing Optimizations Hi, and welcome to this module on Testing Optimizations in the ASP. NET Web Optimization Library. In the end, the best code is always the code that lends itself easily to adding automated tests in the form of both integration and unit tests. The Virtual Path Provider makes an appearance in the Optimization Library and gives us the true power to retrieve resources from virtually any location we can imagine, including databases, the manifest stream, and we can take advantage of the Virtual Path Provider to give us the ability to create powerful unit and integration tests that become essential in your long-term maintenance of your application.