Skip to main content

Answered Question REST Service cache problemRSS Feed

(0)

eric_delahaye@hotmail.com
eric_del...

Member

Member

181 points

43 Posts

REST Service cache problem

Hello, I have a problem with astoria rest services (ADO.Net Data Services) and the cache

I am consuming a rest service basically a "select * from table" from my silverlight application.
My problem is that the result is always the same but i update the table.
Investigating with http monitor i realized tha the result is always from cache, that is the cause.
How can i clear the cache and always have a updated data?

 

In develop enviroment this problem didn't exist but now in production yes... i'm nervous... any suggestion is welcome

 

Thanks.

EriC#

gabouy
gabouy

Member

Member

219 points

45 Posts

Re: REST Service cache problem

It doesn't seem to be a silverlight issue, If I were you I'd also post this question in a Data Services forum :)

(please mark as answer if this post answered your question)

Gabriel

eric_delahaye@hotmail.com
eric_del...

Member

Member

181 points

43 Posts

Answered Question

Re: REST Service cache problem

Ugly response Confused

Ok.

Lesson 1
The most important options for working with data in Silverlight

1. SOAP
2. REST

Then, this can be a problem of interest for this forum.

I resolve the problem adding [QueryInterceptor("Element")] attribute on the server the for my query resources then for the implementation y write 
OutgoingWebResponseContext outResponse = WebOperationContext.Current.OutgoingResponse;
outResponse.Headers.Add("cache-control", "no-store, no-cache, must-revalidate");
outResponse.Headers.Add("Pragma", "no-cache");
outResponse.Headers.Add("ROBOTS", "NOARCHIVE");
 

I hope that my experience will serve other to resolve this problem with which you can meet when develop Silverlight applications.

Thank you gabouy Cool

EriC# 

 

 

 

EriC#

gabouy
gabouy

Member

Member

219 points

45 Posts

Re: Re: REST Service cache problem

sorry, didnt mean to be "ugly", only to point out another source for help since you were becoming "nervous" (do notice the "also")

(please mark as answer if this post answered your question)

Gabriel
  • Unanswered Question
  • Answered Question
  • Announcement