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)

Is Crm web api $expand entities/relationships cached in browser

(0) ShareShare
ReportReport
Posted on by 2

Hi,

I have an web api which has $expand which retrieves values from more than 3 relationships. Now i have changed some boolean value in one of entity(or relationsips) included in $expand. But to my surprise, it web api call returns the old value.

But when i run the web api in new incognito/private brwosing window, the webapi call returns the correct and updated value. Does CRm WEB API cache some values by default. Please help.

Thanks
Goutham

*This post is locked for comments

I have the same question (0)
  • Goutham A Profile Picture
    2 on at

    PLease help if any ideas

  • Suggested answer
    Alagunellaikumar Profile Picture
    6,212 on at

    Hi

    Try to clear the browser cache

  • Goutham A Profile Picture
    2 on at

    I cannot clear the browser cache for each and every web api request . other components have dependency on it

     Please help if we can prevent storing web api response in cache

  • Suggested answer
    Alagunellaikumar Profile Picture
    6,212 on at

    HI

    WEb API Response are wont cache by browser. Could you please try to clear cache or reset IIS?

    It is one time only, try it.

  • Suggested answer
    Goutham A Profile Picture
    2 on at

    Finally got...i am not sure where the web api response is getting cached but i found a way to stop caching. We need to include the request header "Cache-Control"  in web api request,   as req.setRequestHeader("Cache-Control", "no-cache")

    Thank you everyone for your suggestions.

  • CVO Profile Picture
    77 on at

    The above doesn't work for me for some reason on the latest version of the portals doing a simple GET WebApi read (through the safeAjax method).

    My Portal creates a record in D365 using WebApi, which then triggers a plug-in to call an external 3rd party API.  My portal needs to monitor a field on the created record for the API response, but it always comes back blank, even though I see the field is updated in the entity in D365.

    I've been able to get around it by adding a dynamic query on to the existing query.  I put the following query on the end of my odata:

    "/_api/entity_name(entity_id)?$select=v1_data&$filter=v1_data ne '" + Date.now() + "'",

    Now everytime I update the field, I get the latest data in the portal!  Hope this helps someone out there who is having issues with cached data coming back from the web api (obviously change v1_data to the name of your field)!

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