clearing cache when related documents changes

Quang Lai asked on March 4, 2016 20:19

We have a profile page type where a professional's bio can be entered in the Form tab. When a regular form field (text box, multiple choice) is updated, the cached is cleared on check-in and we see the changes right away as expected.

On the profile page there is also a Repeater web part listing the person's related articles. However, when we add/remove related documents (via the bio form via the related pages form control) and check in the changes, the profile page does not reflect the change. The only way we have managed to have the cached cleared is:

  • System => Clear Cache (too heavy handed, and content editors do not have access)
  • Pages => Design tab => check out / check in (too complicated, and content editors may not have access to the Design tab)

We have tried with unsuccessful results:

  1. Pages => Properties => General => Clear Output Cache
  2. Adding a OutputCacheDependencies web part
  3. Setting the Repeater web part's Partial Cache dependencies

For #2 and #3, we have tried:

  • nodeid|{% CurrentPageInfo.NodeID #%}|relationships
  • nodeid|{% CurrentPageInfo.NodeID #%}|(relationship name)
  • nodes|(site)|(profile page type)|all

Maybe our dummy keys are incorrect, but the documentation ( doesn't have an example for related pages.

Correct Answer

Quang Lai answered on March 4, 2016 23:25

We found the solution. Turns out we were putting the dummy key nodeid|{% CurrentPageInfo.NodeID #%}|relationships in the wrong section of the web part. We were putting it in the Performance => Partial cache dependencies, when we should've put it in System Settings => Cache dependencies.

0 votesVote for this answer Unmark Correct answer

Recent Answers

Zachary Perry answered on March 4, 2016 20:52

nodes|(site)|(profile page type)|all is this a copy and paste of the value you used? Are you using the correct classname?

That should work assuming the the correct data is being used and that use partial cache is enabled for the web part.

If all else fails you could go down the event handler path.

1 votesVote for this answer Mark as a Correct answer

Quang Lai answered on March 4, 2016 21:58

Hey Zachary, no that wasn't a copy and paste - there's proper values in the (..) items on our end. There's no typo's as well; and this was the first dummy key we tried.

After my post, we've been looking at doing it via event handling code instead as you mentioned.

0 votesVote for this answer Mark as a Correct answer

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