Tip #784: Some finesse in portal cache resets

FlamethrowerNot so long ago we tipped about flushing your portal cache. The main advice is still valid:

Do not use cache invalidation handle

This method no longer works in online portals, and is now obsolete.

Turning your portal off and then back on still works but it’s like using a flamethrower to kill a mosquito. It takes few minutes to accomplish the task and it disrupts the availability of your portal.

Good news is there are better methods now.

  • In a recent update to online service you will now see a reset portal button, which will automate the stop/start the portal for you, invalidating the entire cache.
  • Updating the website record in CRM, ie change the name field will also do the job. Note: this is not a formal mechanism because it was added as a temporary measure, and theĀ development team reserves the right to remove this behavior in the future.
  • Publishing all customizations in CRM will also invalidate the portal cache.

The above methods are effective but dropĀ the entire cache indiscriminately. Much better and recommended approach is to ensure that “Change tracking” is enabled for the entities used in the portal.

Change tracking for an entity

If this option is enabled, you don’t have to do any of these tricks to clear up cache. Portals use change tracking feature to intelligently refresh the portal cache for a specific entity without resorting to a big hammer.

Thanks to Tanguy “The XRM Toolbox” Touzard and Shan “Smoke ’em” McArthur for beating the issue into a pulp.

VN:F [1.9.22_1171]
Rating: 5.0/5 (3 votes cast)
Tweet about this on TwitterShare on Facebook2Share on Google+2

8 thoughts on “Tip #784: Some finesse in portal cache resets

  1. Vlad says:

    This I a great tip. Global cache reset however may still be required when CRM metadata changes, like adding-removing fields, changing option sets, etc. Sometimes the tracking does not pick such changes.

  2. Nick says:

    This is an awesome tip. I assume however, that this won’t work on legacy Adxstudio Portals (v7) ?

    Cheers
    Nick

  3. […] Dynamics 365 portals cache reset, please refer to this great crm tip of the day post. The main point is that you should turn on “Change Tracking” for the entities used in […]

Leave a Reply

Your email address will not be published. Required fields are marked *