Widget Partial Caching

Siavash Mortazavi asked on June 7, 2016 16:36


I have a custom widget that apparently doesn't get cached. Here is the scenario:

  1. Partial caching is enabled in System settings.
  2. I have created a custom web part.
  3. I have set the default value of "PartialCacheMinutes" to 1 for the web part.
  4. I have created a custom widget on top of my web part from step 1.
  5. In the "security" tab of the widget settings, I have made it possible for the widget to be used on page tab of the "Pages" application.
  6. I add a widget to the webpage from the "page" tab of the "Pages" application.
  7. I have added a debugging code to put the current time on top of the web part output, and actually refreshing the page displays new times every time, and it is not getting cached for 1 minute.

  8. I tried the standard <%@ OutputCache Duration="60" VaryByParam="None" %> on top of my .ascx file, but it didn't work.

  9. When I create the widget out of webpart, the "PartialCacheMinutes" system property is not visible on the widget's system property tab, so I cannot check off this property as "Display field in the editing form" to expose it on the page tab of the "pages" application, to set the there.

By explaining the situation, I have 2 questions please: 1. How can I enable caching for widgets that are insert-able on the "Page" tab? 2. How can I add query string dependencies to them (for example, for a query string key called "id")?

Thanks, Sia

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