Click here to Skip to main content
15,890,512 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to avoid repeating dynamic tabitem at runtime? Pin
Pete O'Hanlon3-Sep-13 2:02
mvePete O'Hanlon3-Sep-13 2:02 
GeneralRe: How to avoid repeating dynamic tabitem at runtime? Pin
LAPEC3-Sep-13 3:12
LAPEC3-Sep-13 3:12 
GeneralRe: How to avoid repeating dynamic tabitem at runtime? Pin
Pete O'Hanlon3-Sep-13 3:59
mvePete O'Hanlon3-Sep-13 3:59 
QuestionMVVM pattern Pin
columbos1492731-Aug-13 18:46
columbos1492731-Aug-13 18:46 
AnswerRe: MVVM pattern Pin
SledgeHammer013-Sep-13 9:56
SledgeHammer013-Sep-13 9:56 
GeneralRe: Prism Quick Starts Pin
NotPolitcallyCorrect30-Aug-13 4:29
NotPolitcallyCorrect30-Aug-13 4:29 
QuestionHow to force refresh of images being cached in Silverlight Deep Zoom app? Pin
Member 297027028-Aug-13 6:04
Member 297027028-Aug-13 6:04 
AnswerRe: How to force refresh of images being cached in Silverlight Deep Zoom app? Pin
Jason Gleim28-Aug-13 7:49
professionalJason Gleim28-Aug-13 7:49 
I've dealt with the caching of the SL xaps before, especially in IE, and there is a technique there that works well to avoid that problem. I'm not sure if it will address your issue but it should be pretty easy to test.

The problem is that even if you set a content expiration policy on your resources, IE ignores it. You can see this by running your app with Fiddler running in the background. You will probably see 304 requests for your images which means IE is asking if it needs to update the image.

The key is the URL. IE determines if it should request a resource or ask if it should be refreshed based on the URL. To IE, your image request looks like http://myserver/foo.jpg every time the image is called. IE will look in the cache and make a content refresh request to the server. If the name is the same, you get the cached version. Same things happens for XAPs which is what was bothering me.

The fix is to pass a bogus parameter in the URL. So change the image request to http://myserver/foo.jpg?bogus=1. The parameter name and number can be anything. Each time you need to force a download of the image, just change the number. This will create a new, unique URL as far as the browser is concerned and new URLs are never checked against the cache. This should be easy to test by adding the parameter to the web request and then incrementing it while watching what happens in Fiddler.

If you always update the images in lock-step with the xap, you could just pass an assembly version number as the parameter. Another possibility (and the one I use) is to patch the hosting page with a bit of PHP that allows your application to get the date & time on the image file and pass that as the parameter. The nice thing here is that as soon as the image is updated on the server, the result of that call will change and the resulting URL will change. Since you are calling inside your app, you would probably need a web service or something that would allow you to do that before calling for the image appending the date/time to the web request.

While these links apply to xaps, the same should work for the image files as well. Here is one for configing the expiration policy on IIS:
http://mattduffield.wordpress.com/2011/08/26/having-problems-with-iis-caching-your-silverlight-application/[^]

Here is the date/time trick embedded in the web page:
http://codeblog.larsholm.net/2010/02/avoid-incorrect-caching-of-silverlight-xap-file/[^]

And finally, here is a guy that refined the previous post:
http://derreckdean.wordpress.com/2012/03/14/ie9-and-silverlight-caching-problems/[^]

HTH!
GeneralRe: How to force refresh of images being cached in Silverlight Deep Zoom app? Pin
Member 297027028-Aug-13 8:14
Member 297027028-Aug-13 8:14 
GeneralRe: How to force refresh of images being cached in Silverlight Deep Zoom app? Pin
Jason Gleim28-Aug-13 8:18
professionalJason Gleim28-Aug-13 8:18 
GeneralRe: How to force refresh of images being cached in Silverlight Deep Zoom app? Pin
Member 297027028-Aug-13 8:44
Member 297027028-Aug-13 8:44 
GeneralRe: How to force refresh of images being cached in Silverlight Deep Zoom app? Pin
Jason Gleim28-Aug-13 8:54
professionalJason Gleim28-Aug-13 8:54 
QuestionCan someone explain this PRISM concept? Pin
SledgeHammer0127-Aug-13 8:39
SledgeHammer0127-Aug-13 8:39 
QuestionAssign a null value to DateTime property Pin
maxRazar26-Aug-13 21:00
maxRazar26-Aug-13 21:00 
AnswerRe: Assign a null value to DateTime property Pin
Pete O'Hanlon26-Aug-13 23:02
mvePete O'Hanlon26-Aug-13 23:02 
GeneralRe: Assign a null value to DateTime property Pin
maxRazar28-Aug-13 5:57
maxRazar28-Aug-13 5:57 
GeneralRe: Assign a null value to DateTime property Pin
Pete O'Hanlon28-Aug-13 21:56
mvePete O'Hanlon28-Aug-13 21:56 
AnswerRe: Assign a null value to DateTime property Pin
Jason Gleim27-Aug-13 5:30
professionalJason Gleim27-Aug-13 5:30 
GeneralRe: Assign a null value to DateTime property Pin
maxRazar28-Aug-13 5:57
maxRazar28-Aug-13 5:57 
AnswerRe: Assign a null value to DateTime property Pin
koll Zhu22-Sep-13 23:47
koll Zhu22-Sep-13 23:47 
QuestionProper way to do this in MVVM? Pin
SledgeHammer0126-Aug-13 11:46
SledgeHammer0126-Aug-13 11:46 
AnswerRe: Proper way to do this in MVVM? Pin
Pete O'Hanlon26-Aug-13 12:39
mvePete O'Hanlon26-Aug-13 12:39 
GeneralRe: Proper way to do this in MVVM? Pin
SledgeHammer0126-Aug-13 12:56
SledgeHammer0126-Aug-13 12:56 
AnswerRe: Proper way to do this in MVVM? Pin
Abhinav S26-Aug-13 16:29
Abhinav S26-Aug-13 16:29 
QuestionTreeView Pin
columbos1492726-Aug-13 2:32
columbos1492726-Aug-13 2:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.