Refresh Business Data Cache Adapters on Demand

As a follow-up to a recent blog posting on using the Business Data Cache Adapter, it was mentioned that you can refresh the cache on demand.  This is a great option when users need the latest and greatest results for perhaps going into a board meeting or team meeting.

In the screenshot below, this page has three displays all using the Business Data Cache Adapter.  The cache adapter improved performance on this particular page by 80%.  The cache has a cache interval of 10 minutes.  If a user needed the latest numbers, they can click the Update Data link in the upper left hand corner of the page to refresh the cache and see the latest and greatest.

You simply place a Content Editor Web Part on the page and configure it something like the code below.

It’s simply formatting a table with an image and a link with an onclick javascript function.  This function is being used because the page is contained within the content panel of a CorasWorks template.  The function reloads the content panel using the same page URL but we have added ?refreshcache=true to the end of the page URL.

This directive tells any cache adapters being utilized on the page to refresh the cache rather than using the cached data.

Below you will find two screenshots that show that in order of the displays on this page to receive the directive, they must be configured to use passthrough.

This screenshot is how to configure the WorkPlace Suite Grid view that is using a cache adapter for its data.  You simply put in your Pass Through XML and the grid will look to see if the ?refreshcache=true has been added to the page URL.  If it has when the cache adapter executes, it will refresh the cache.

Nearly every Toolset component contains the ability to do passthrough.  On our page we also have a Custom Display Adapter, the screenshot below shows you where you would configure the Pass Through XML.

 

Comments are closed.