samedi 22 août 2015 mvc bundling or caching


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 mvc, I believe that we have bundling. With reference to following lin k,

  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:

    <add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"  />
    <add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />

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?


Aucun commentaire:

Enregistrer un commentaire