web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

304 response from WebApi

(0) ShareShare
ReportReport
Posted on by 3,115

Hi Techeies


Facing a strange problem (in OOB organization as well). I have an entity (say account) which has 1:n relation with another entity (say contact). I'm using webapi to retrieve data of parent & child entities using following query.

https://MYORG.api.crm8.dynamics.com/api/data/v8.1/accounts%28475b158c-541c-e511-80d3-3863bb347ba8%29?$select=name&$expand=contact_customer_accounts%28$select=fullname%29


This is working fine when for the first time i'm retrieving data. If I Associate one another contact to the same account and run the query it is not reflecting the newly added query. In this scenario fiddler is showing response status 304. Also, this is always happening if I open it through Firefox and in some machines it is happening in IE as well.

I have even tried with request header "Cache-Control: no-cache", but no success. Any one faced this kind of problem ? Is there any way that I can force WebApi to return data all the times ?

Thank you

Srikanth.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    DigitalFlow Profile Picture
    80 on at

    Hey there,


    you probably already solved your problem, but I found the solution for anyone coming here:

    Attach the "If-None-Match" header with empty string value to Get requests and you will receive a new response for each request.

    Code:

    xhr.setRequestHeader("If-None-Match", null);

    Be sure to really pass null and not an empty string, as IE will inject the last E-Tag instead of the empty string that you passed and thus activate caching again...


    Kind Regards,

    Florian

  • ansrikanth Profile Picture
    3,115 on at

    Wow, That is a nice hack, It wasn't solved yet, but I got an alternate for the situation henceforth left it over there.. Thanks for the help anyways, I will check it..

    Btw, We have raised a ticket with MS at the same time, after 10 to 12 calls also there is no proper solution for this from MS and we thought of leaving the ticket as we are bit occupied in other works :)

  • thomasjs Profile Picture
    User Group Leader on at

    This helped me a lot. I was using the rest builder in Dynamics 365, and getting cached info back.

    docs.microsoft.com/.../compose-http-requests-handle-errors

    This was the link I as trying to use, but I got the syntax wrong. With the " at the right place, my null was right;)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans