+1  to Stephen

I found this in my blog post draft folder


<body>

    <form id="form1" runat="server" style="height:100%">

    <div id="silverlightControlHost">

        <object data="data:application/x-silverlight-2,"
type="application/x-silverlight-2" width="100%" height="100%">

        <%

            const string filename =
@"ClientBin/SilverlightApplication2.xap";

            string version = (new
System.IO.FileInfo(Server.MapPath(filename))).LastWriteTime.ToString("yyyyMMddhhmmss");

            Response.Write("     <param name=\"source\" value=\"" + filename
+ "?" + version + "\" />");

        %>

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

          <param name="background" value="white" />

          <param name="minRuntimeVersion" value="4.0.50826.0" />

          <param name="autoUpgrade" value="true" />

          <a href="
http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0";
style="text-decoration:none">

               <img src="http://go.microsoft.com/fwlink/?LinkId=161376";
alt="Get Microsoft Silverlight" style="border-style:none"/>

          </a>

        </object><iframe id="_sl_historyFrame"
style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>

    </form>

</body>




And add at the top of that ASPX, in order to avoid caching of the hosting
ASPX



<%

    Response.Expires = -1;

    Response.AddHeader("Pragma", "no-cache");

    Response.AddHeader("cache-control", "no-store");

%>



.peter.gfader. (current mood = happy)

http://blog.gfader.com




On Thu, Sep 8, 2011 at 7:15 AM, Stephen Price <step...@littlevoices.com>wrote:

> Ah didn't see this other thread.
>
> If you use the last modified time of the xap file then you will download
> the new version and if its updated then you automatically get the new one,
> but don't download it every time (which would happen if the url was
> different on every page load.)
> you only want the client to download it if the xap file has changed. put
> the modified date/time in the url and forget about it. move on to more
> interesting problems. :)
>
> On Thu, Sep 8, 2011 at 12:12 PM, Greg Keogh <g...@mira.net> wrote:
>
>>
>> http://stackoverflow.com/questions/2281919/expiry-silverlight-xap-file-from-browser-cache-programmatically
>> ****
>>
>> ** **
>>
>> Interesting ... some solutions are browser specific, some need code and
>> maintenance. Adding the “Cache-Control: no-cache” header seems the easiest
>> by far, so I’ll try it out at the app level (it’s under the IIS – HTTP
>> Response Headers). I’m not feeling confident.****
>>
>> ** **
>>
>> Greg****
>>
>> _______________________________________________
>> ozsilverlight mailing list
>> ozsilverlight@ozsilverlight.com
>> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>>
>>
>
> _______________________________________________
> ozsilverlight mailing list
> ozsilverlight@ozsilverlight.com
> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
>
>


-- 

.peter.gfader.
Current mood = happy!

Check this before you go live
http://blog.gfader.com/2011/07/website-check-list-part-1-aspnet-4.html
_______________________________________________
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to