zoukankan      html  css  js  c++  java
  • Avoid incorrect Silverlight XAP file caching

    Avoid incorrect Silverlight XAP file caching

    with 36 comments

    The code below appends the last-write filedate of the Silverlight Application XAP file to the path in the source parametre of the Silverlight object tag.
    This will ensure that poorly constructed caching functionality of webbrowsers and proxy servers doesn’t incorrectly use old, wrong builds of the XAP file.
    However it will still allow these caches to work. Furthermore a check is performed to avoid XAP file path alteration during debugging, this is to allow debugging tools such as Silverlight Spy to continue functioning.

    <object id="Xaml1" data="data:application/x-silverlight-2," type="application/x-silverlight-2"

    width="100%" height="100%">

    <%––<param name="source" value="ClientBin/SilverlightApp.xap"/>––%>

    <%

    string orgSourceValue = @"ClientBin/SilverlightApp.xap";

    string param;

    if (System.Diagnostics.Debugger.IsAttached)

    param = "<param name=\"source\" value=\"" + orgSourceValue + "\" />";

    else

    {

    string xappath = HttpContext.Current.Server.MapPath(@"") + @"\" + orgSourceValue;

    DateTime xapCreationDate = System.IO.File.GetLastWriteTime(xappath);

    param = "<param name=\"source\" value=\"" + orgSourceValue + "?ignore="

    + xapCreationDate.ToString() + "\" />";

    }

    Response.Write(param);

    %>

    <param name="onError" value="onSilverlightError" />

    http://codeblog.larsholm.net/2010/02/avoid-incorrect-caching-of-silverlight-xap-file/#comment-20

  • 相关阅读:
    小清新数论题泛做
    近日模考理数压轴题简记
    带边数的无向连通图计数
    ZJOI2019 简记
    SDOI2019 R2D2 题解
    [补档题解]后缀树节点数
    [BJ United Round 3] 押韵
    高维 DFT 算法(FWT 快速沃尔什变换)
    SDOI2019 R2D1 题解
    LOJ#6713. 「EC Final 2019」狄利克雷 k 次根 加强版
  • 原文地址:https://www.cnblogs.com/Areas/p/2252715.html
Copyright © 2011-2022 走看看