Here's the problemo:
My Silverlight application is calling a HTTP web service, using WebClient, called getCampaigns which returns a JSON array of data for Campaign objects. The user can then interact with the requested objects, modifying them, removing them, etc. When the user removes a campaign, Silverlight calls another web service, which flags the object in the database so it won't be returned in the future, and then refreshes the page by calling getCampaigns. The problem is the removed campaign still shows up.
If I check the database, the campaign truly has been disabled, and if I close the Silverlight application and restart it, the campaign doesn't appear. It appears that Silverlight is caching the web service call. But each time the call is made a new WebClient object is instantiated.
Any ideas?
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=340931&wa=wsignin1.0
Two workarounds are given. I'm appending a Guid to my Url, so each web service call is completed using a unique Url.
Any HTTP GET requests in Silverlight tend to cached, so if you want to eliminate caching by the client browser use HTTP POST to make web service calls. For example in WCF RIA Domain Services mark your invoke and query methods as such:
HasSideEffects simply states that it should use the POST method to avoid the caching mechanism of the client GET. Remember SL by default uses the browser to make web service calls and by default uses GET which is cacheable. That's why your web service calls to services even outside of RIA are being cached: the browser's seeing you use HTTP GETs and is caching the result.
The use of GET by default for web service calls is for performance reasons because POST responses are uncacheable by all major browsers per RFC 2616 which states that POST should be an idempotent operation (aka always results in an expected result which caching would break because the result may change over time).
Other operations in RIA involve setting caching by using LoadBehavior on LoadOperations.
There is no cache of web service calls. You probably have a problem in your refresh method.
This is an old thread but I'll chime in just in case someone comes across the same problem. A work around is if you have access to the user's browser is to set do refresh the cache for every page request. You do this by going into IE's Internet Options (IE 8), then in the General Tab go the Browsing History Settings button and select "Every time I visit the webpage" Hope it helps someone