I'm experiencing this same problem when trying to read a RSS feed. Although the feed is updated i get an old version of the feed when reading using webclient!
Might be a long time since last entry but now I'm also affected by that bug. And I'm using Silverlight 2 Release version. Unfortunately the workaround won't do it. Anyone has an idea why?
Maybe I should mention the following:
1. I use OpenReadAsync
2. I download a zip-file
3. Even pressing refresh-button of the browser does not do it
I think that WebClient in Silverlight is just passing along the caching that the server decides to allow. This sounds like a safe idea that will protect people who expose services to the Web.
I was frustrated at first too and then I looked into one of the posts above and found this site:
I put this right under the @page tag and it completely solved the problem that I was having accessing my service. This should help solve these problems if you are using ASP .Net
kakoskin
Member
37 Points
31 Posts
Re: WebClient and caching
Aug 25, 2008 08:54 AM | LINK
I'm experiencing this same problem when trying to read a RSS feed. Although the feed is updated i get an old version of the feed when reading using webclient!
webclient cache problem
moemeka
Member
149 Points
70 Posts
Re: WebClient and caching
Oct 15, 2008 03:35 PM | LINK
see my link above
http://moemeka.blogspot.com
andulvar
Member
181 Points
129 Posts
Re: Re: WebClient and caching
Nov 08, 2008 11:23 AM | LINK
I'm also affected by this. I'm using the random request work-around, but it makes my teeth grind.
meykih
Participant
1049 Points
260 Posts
Re: Re: WebClient and caching
Jul 22, 2009 09:57 AM | LINK
Might be a long time since last entry but now I'm also affected by that bug. And I'm using Silverlight 2 Release version. Unfortunately the workaround won't do it. Anyone has an idea why?
Maybe I should mention the following:
1. I use OpenReadAsync
2. I download a zip-file
3. Even pressing refresh-button of the browser does not do it
Please help!
Maike Ohlig
Please mark post as answer if it helped you
digvijay.live
Member
8 Points
5 Posts
Re: WebClient and caching
Sep 04, 2009 10:31 AM | LINK
Indeed there is a way:
Just set the following property of WebClient instance
source: http://code.mareoblo.pl/2008/12/11/c-winforms-%E2%80%93-manage-cache-state-with-webclient-cachepolicy/
WebClient caching
sl.ayer
Participant
1693 Points
288 Posts
Re: WebClient and caching
Sep 04, 2009 11:22 AM | LINK
System.Net.Cache is not available in Silverlight. Correct way to handle this issue is to set proper cache-control headers server side.
jatin.sabarmati
Member
23 Points
74 Posts
Re: Re: WebClient and caching
Feb 23, 2010 03:05 PM | LINK
I am not sure if the problem is yet present in Silverlight 4 Beta ,anyone did find any good solution to the problem please post .
any idea if System.Web.Cache is going to available in Siverlight 4 .
2r0y
Member
2 Points
1 Post
Re: Re: WebClient and caching
Mar 02, 2010 04:51 AM | LINK
I think that WebClient in Silverlight is just passing along the caching that the server decides to allow. This sounds like a safe idea that will protect people who expose services to the Web.
I was frustrated at first too and then I looked into one of the posts above and found this site:
http://msdn.microsoft.com/en-us/kb/kb00323290.aspx
It explains may ways to deal with caching in an ASP .Net application. I simply used this line in my RESTful service that I had exposed to Silverlight:
<%@ OutputCache Location="None" VaryByParam="None" %>
I put this right under the @page tag and it completely solved the problem that I was having accessing my service. This should help solve these problems if you are using ASP .Net
LaWFuLEviL
Member
30 Points
15 Posts
Re: Re: WebClient and caching
Aug 11, 2010 11:38 PM | LINK
Coming across the same issue in Silverlight 4.
Any right way to do this yet ?
Viento85
Member
2 Points
1 Post
Re: Re: WebClient and caching
Dec 29, 2010 02:29 PM | LINK
Hi memoka,
your solution is not working.
Also System.Net.Cache is still unavailable in Siverlight 4, what can we do??? help...