Search code examples
dynamics-crmdynamics-crm-2015

What (and where) is the cache.axd handler referred to in the Dynamics CRM 2015 Portal walkthroughs?


We are investigating the Developer Extensions package for Microsoft Dynamics CRM 2015. In this article, they show you how to add a CRM plugin that will invalidate your website's cached data when entities are updated within CRM.

The articles says:

The URL to your cache invalidation will be http(s)://your-website-domain/Cache.axd.

I don't have a Cache.axd in my solution, nor do I have any configuration line that would map this handler to a DLL or other component in the Microsoft DLLs referenced by my solution. An HTTP request to http://mysolution/Cache.axd returns an HTTP 404.0 Not Found.

Where is Cache.axd? Where does it come from and how does it work? I can find no reference to it anywhere in the Dynamics CRM SDK or the documentation.


Solution

  • The Cache.axd URL needs to be mapped to the Microsoft.Xrm.Portal.Web.Handlers.CacheInvalidationHandler class that's included with the CRM SDK.

    The idea being that the custom portal caches data to improve performance, then when something changes in CRM you can invalidate the portal's cache using the approach described in your article above.

    ... web notification URL (from the Settings menu) that goes to the cache invalidation handler of your website ...

    Cache can also be invalidated manually by recycling the application pool, rebuilding the website in Microsoft Visual Studio, saving the web.config file, or by adding a browser toolbar button that will hit the cache invalidation handler. This will refresh the website with the Microsoft Dynamics CRM changes.

    I happen to know this because this is the same approach AdxStudio use. This article describes the AdxStudio involvement and provides links to download the portal websites (if you havnt already). Announcing the Customer and Partner Relationship Management Portals!.

    If you are building a portal using the accelerators above then Cache.axd will be relevant to you. If you are just building something custom then the use and implementation of caching is up to you.