Is partial caching with widgets possible?

Regis Wengel asked on June 7, 2018 19:00

I'm trying to optimize a site by using partial caching. On the home page there are several widgets that are taking longer to load. I wanted to apply partial caching to these widgets. However, when I go to edit a widget in the widget application there's no options to edit partial caching in the system properties tab like there is for the web parts. I understand that widgets are based off of their web part, but I'm not sure it inherits the partial caching as there's not way to define it on a widget level. There doesn't seem to be any documentation for caching widgets. When describing partial caching the documentation only ever mentions being able to cache web parts this way, never widgets. Is it possible to using partial caching on widgets and if so how? Do I simply put a default PartialCacheMinutes value in the web part?

Partial caching is enabled in the settings for the site.

Recent Answers


Brenden Kehren answered on June 7, 2018 19:28

In the widget's System Properties, you can set those default values. Then it's only set for the widget and not the webpart as well. This allows you some flexibility if you reuse that webpart in multiple places.

0 votesVote for this answer Mark as a Correct answer

Regis Wengel answered on June 7, 2018 19:33

As I said in my post there is no partial caching option when I go to the widget's System Properties.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 7, 2018 19:36

Totally missed that and going off of memory, sorry Regis. Yes, make the modification at the webpart level. I vaugely remember adding in those same property names on the widget for caching that are on the webpart and having them pass through but that was a project a few years ago on v9 I believe. We may have even created a custom webpart for that too. Might be worth a shot.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.