I'm using ASP.NET MVC bundles to organise and optimise my scripts and CSS. The site I'm currently developing needs to perform well on mobile networks, so I'm trying to get all my html, JavaScript and CSS into a single request. Is there any way to get an MVC bundle to inline its contents in the requested html?
Yes, there is. I've blogged about how to inline script and style bundles because I was facing the exact same problem. Here's the post:
The basic idea is to grab the BundleResponse
that's created by the System.Web.Optimization framework and emit its contents within a <style>
or <script>
tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With