Re: Refreshing an SL4 app (client problem?)

2011-09-08 Thread Peter Gfader
+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(MMddhhmmss);

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=149156v=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

/objectiframe 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.comwrote:

 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


RE: Refreshing an SL4 app (client problem?)

2011-09-08 Thread Jake Ginnivan
I have used this approach too. I actually have a Build.txt in the root of the 
application, and set the build number in the web.config and I use:

App.xap?v=2.0.0.1

The query string difference is also enough to invalidate the cache, and it can 
be put into the build process easily and only invalidates on a new build.

Regards,
Jake Ginnivan
Readify | Senior Developer | MVP (VSTO)
M: +61 403 846 400 | E: 
jake.ginni...@readify.netmailto:jake.ginni...@readify.net | W: 
www.readify.nethttp://www.readify.net/

From: ozsilverlight-boun...@ozsilverlight.com 
[mailto:ozsilverlight-boun...@ozsilverlight.com] On Behalf Of Simon Hammer
Sent: Thursday, 8 September 2011 12:07 PM
To: ozSilverlight
Subject: RE: Refreshing an SL4 app (client problem?)

Hi Greg,

Funny, I was dealing with this today

We handle this by having a version number in the xap filename (eg. 
SLAppName1.5.2.xap).  This way whenever a new build goes on production, we know 
browsers will referencing the correct one.

Simon.

From: Chris Anderson 
[mailto:christheco...@gmail.com]mailto:[mailto:christheco...@gmail.com]
Sent: Thursday, 8 September 2011 2:02 PM
To: ozSilverlight
Subject: Re: Refreshing an SL4 app (client problem?)

It's because the browser is caching the app, and your IIS probably doesn't set 
any cache expiry headers.  Here's some info:

http://stackoverflow.com/questions/2281919/expiry-silverlight-xap-file-from-browser-cache-programmatically

Chris

On 8 September 2011 13:58, Greg Keogh g...@mira.netmailto:g...@mira.net 
wrote:
Well I should have asked my cat, because I browsed to the SL4 app from the 
outside world and it was the latest version. When browsing from my work machine 
I see the old version. So I restart my localhost IIS and delete temporary files 
in the browser, but it makes no difference. As an administrator I delete all 
local v2 and v4 ASP.NEThttp://ASP.NET temporary files and restart IIS, now 
it's fixed.

So it looks like the problem was on my client side, not on the server machine 
side. I'm not sure which step fixed the problem, but it *might* have been 
deleting the local temporary files.

Greg

___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.commailto:ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
__
___
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight


RE: Refreshing an SL4 app (client problem?)

2011-09-07 Thread Greg Keogh
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