Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For anyone needing a solution to this in ASP.NET, this sets the Cache-Control header as per <a href="http://stuartroebuck.blogspot.com/2010/08/official-way-to-bypassing-data.html" rel="nofollow">http://stuartroebuck.blogspot.com/2010/08/official-way-to-bypassing-data.html</a> for javascript files using URL Rewrite Module 2.0 <a href="http://learn.iis.net/page.aspx/665/url-rewrite-module-20-configuration-reference" rel="nofollow">http://learn.iis.net/page.aspx/665/url-rewrite-module-20-configuration-reference</a>.</p> <pre><code>&lt;system.webServer&gt; &lt;rewrite&gt; &lt;outboundRules&gt; &lt;rule name="Compression header" preCondition="Match JS Files"&gt; &lt;match serverVariable="RESPONSE_Cache-Control" pattern="(.*)" /&gt; &lt;action type="Rewrite" value="no-transform" /&gt; &lt;/rule&gt; &lt;preConditions&gt; &lt;preCondition name="Match JS Files"&gt; &lt;add input="{RESPONSE_CONTENT_TYPE}" pattern="(javascript)$" /&gt; &lt;/preCondition&gt; &lt;/preConditions&gt; &lt;/outboundRules&gt; &lt;/rewrite&gt; </code></pre> <p>Alternatively can be done using a HttpModule</p> <pre><code>public class AddHeaderModule : IHttpModule { public void Init(HttpApplication context) { context.EndRequest += OnEndRequest; } void OnEndRequest(object sender, System.EventArgs e) { if(HttpContext.Current.Response.ContentType.Contains("javascript")) HttpContext.Current.Response.Headers.AddHeader("Cache-Control", "no-transform"); } } </code></pre> <p>and </p> <pre><code>&lt;configuration&gt; &lt;system.web&gt; &lt;httpModules&gt; &lt;add name="AddHeaderModule" type="your.namespace.AddHeaderModule" /&gt; &lt;/httpModules&gt; &lt;/system.web&gt; &lt;/configuration&gt; </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. This table or related slice is empty.
    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