Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately there is no way. You can find the reason in the internal implementation of bundling. in the <code>BundleHandler</code> class ProcessRequest calls the <code>ProcessRequest</code>, internal method of the <code>Bundle</code> class and it calls SetHeaders just before the <code>HttpContext.Response.Write</code>. Therefore the client cache is set to one year just before the response write. </p> <p>Note: <code>BundleHandler</code> is a internal sealed class: <code>internal sealed class BundleHandler : IHttpHandler</code></p> <p>In the <code>BundleHandler</code> class:</p> <pre><code>public void ProcessRequest(HttpContext context) { if (context == null) { throw new ArgumentNullException("context"); } context.Response.Clear(); BundleContext context2 = new BundleContext(new HttpContextWrapper(context), BundleTable.Bundles, this.BundleVirtualPath); if (!Bundle.GetInstrumentationMode(context2.HttpContext) &amp;&amp; !string.IsNullOrEmpty(context.Request.Headers["If-Modified-Since"])) { context.Response.StatusCode = 304; } else { this.RequestBundle.ProcessRequest(context2); } } </code></pre> <p>In the <code>Bundle</code> class:</p> <pre><code>internal void ProcessRequest(BundleContext context) { context.EnableInstrumentation = GetInstrumentationMode(context.HttpContext); BundleResponse bundleResponse = this.GetBundleResponse(context); SetHeaders(bundleResponse, context); context.HttpContext.Response.Write(bundleResponse.Content); } private static void SetHeaders(BundleResponse bundle, BundleContext context) { if (bundle.ContentType != null) { context.HttpContext.Response.ContentType = bundle.ContentType; } if (!context.EnableInstrumentation) { HttpCachePolicyBase cache = context.HttpContext.Response.Cache; cache.SetCacheability(bundle.Cacheability); cache.SetOmitVaryStar(true); cache.SetExpires(DateTime.Now.AddYears(1)); cache.SetValidUntilExpires(true); cache.SetLastModified(DateTime.Now); cache.VaryByHeaders["User-Agent"] = true; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload