Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
Normally when you query the WebApi for a specific record you'll always get a JSON response back that contains the entity field values at the time of the query.
If your code queries the same record using the WebApi many times then this can introduce overhead that will slow down your code. To combat this, we often introduce elaborate caching schemes but this leads to the challenge of keeping the cache current.
The good news is that the Xrm.WebApi SDK already implements a cache for us inside the retreiveRecord call using the ETag.
Consider a call to retrieveRecord as follows:
The first call will retrieve the record from the server including the ETag value
"name": "Sample Account Mon, 31 Dec 2018 10:36:56 GMT",
The @odata.etag is then used to build a cache of the response that is dependant on the fields that are retrieved.
When you next query for the same record with the same $select attributes the client SDK will send the value of the Etag in the request header:
If the record has not been modified since then the server will return:
HTTP/1.1 304 Not Modified
This indicates that the client side SDK can then reuse the same record that was retrieved previously.
Since it would be quite complex to implement this feature in your hand-build HTTP requests, this is indeed a good reason to use the Xrm.WebApi SDK!
Business Applications communities