samedi 22 août 2015

asp.net mvc bundling or caching

All,

I have couple of questions for the optimization of application and i hope GURUs will help me to select the best approach.

Bundling and Minification

  1. When working with asp.net mvc, I believe that we have bundling. With reference to following lin k, http://ift.tt/1tHBXlU

  2. ASP.NET Optimization framework caches the bundle response in HttpContext.Cache and uses a CacheDependency.

  3. The bundle file name is a hash of the bundle contents which ensures the URL changes when any of the bundle files are modified. The bundle's virtual path is used as the cache key.

  4. Bundles set the HTTP Expires Header one year from when the bundle is created.

Caching in Web.config:

<configuration>
<system.webServer>
<caching>
  <profiles>
    <add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"  />
    <add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
  </profiles>
</caching>
</system.webServer>
<configuration>

My basic question is

  1. which approach is better to optimize performance from both above mentioned techniques? and Why?
  2. What will be the impact of both, preferring Bundling and Minification on Caching js Files in Web.Config and preferring Caching js files on Bundling and Minification?

Thanks.

Aucun commentaire:

Enregistrer un commentaire