Note that there are some explanatory texts on larger screens.

plurals
  1. PO?How do we stop IE9 from always retrieving Out-of-Date Data from Cache?
    text
    copied!<p>Our project uses Silverlight 4 and Microsoft Pivot Viewer which is a Data Presentation tool that works in Silverlight.</p> <p>Microsoft Pivot Viewer makes it easier to interact with massive amounts of data in ways that are powerful, informative, and fun. Microsoft Live Labs tried to step back and design an interaction model that accommodates the complexity and scale of information rather than the traditional structure of the Web.</p> <p>The Module within our application that uses Siliverlight and Microsoft Pivot Viewer has quite a bit of caching problems.</p> <p>The Module within our application that uses Siliverlight and Microsoft Pivot Viewer dynamically retrieves images at runtime so that it present the images to the user in Siliverlight and Microsoft Pivot Viewer.</p> <p>The problem that we have is that IE9 caches the images in Siliverlight and Microsoft Pivot Viewer.</p> <p>The HTTP Response Headers on IIS is configured in such a way that Web Content expires immediately. <img src="https://i.stack.imgur.com/2bwiq.jpg" alt="HTTP Response Headers setting for ClientBin Folder that contains Silverlight XAP"></p> <p>As soon as you add any URL parameter (e.g. “?v1″ or a dynamically generated parameter like in your code), client-side caching is turned off by the browser unless an expiration date is explicitly set.</p> <p>We tried the following in the Siliverlight and Microsoft Pivot Viewer Host ASPX file:</p> <pre><code> &lt;div id="silverlightControlHost"&gt; &lt;object id="pivotViewer" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="900"&gt; &lt;% HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)); HttpContext.Current.Response.Cache.SetValidUntilExpires(false); HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache); HttpContext.Current.Response.Cache.SetNoStore(); string orgSourceValue = @"ClientBin/SilverlightPivotViewer.xap"; string param; if (System.Diagnostics.Debugger.IsAttached) param = "&lt;param name=\"source\" value=\"" + orgSourceValue + "\" /&gt;"; else { string xappath = HttpContext.Current.Server.MapPath(@"") + @"\" + orgSourceValue; DateTime xapCreationDate = System.IO.File.GetLastWriteTime(xappath); param = "&lt;param name=\"source\" value=\"" + orgSourceValue + "?ignore=" + xapCreationDate.ToString() + "\" /&gt;"; } Response.Write(param); %&gt; &lt;param name="onError" value="onSilverlightError" /&gt; &lt;param name="background" value="white" /&gt; &lt;param name="minRuntimeVersion" value="4.0.50401.0" /&gt; &lt;param name="autoUpgrade" value="true" /&gt; &lt;param name="initParams" value="cxml=Resources.cxml" /&gt; &lt;a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=4.0.50401.0" style="text-decoration:none"&gt; &lt;img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/&gt; &lt;/a&gt; &lt;/object&gt;&lt;iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"&gt;&lt;/iframe&gt;&lt;/div&gt; </code></pre> <p>Google Chrome and Mozilla Firefox seem to work fine. However, IE9 fails because it keeps getting Out-of-Date data from Cache for Silverlight.</p> <p>Our following efforts failed to resolved the caching issue:</p> <p>1) IE9 of user still caches even after The HTTP Response Headers on IIS is configured in such a way that Web Content expires immediately. 2) IE9 of user still caches even after we ensure that the Silverlight XAP url is appended with a dynamically generated parameter.</p> <p>Could someone please provide some steps as to how we should resolve the issue?</p>
 

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