+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Clearing/Invalidating Output Cache Programmatically

Clearing/Invalidating Output Cache Programmatically

3 posts, 0 answered
  1. Kris
    Kris avatar
    16 posts
    Registered:
    24 Sep 2012
    30 Jan 2014
    Link to this post

    Is there a way to clear a page's output cache from an onclick event.

    I have a page that has the caching turned on. I have a "refersh" button with an onclick event that needs it clear the page cache so that when the page finishes rendering it will render with the updated data and get added back into cache with the new data.

  2. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    30 Jan 2014 in reply to Kris
    Link to this post
    Hi Kris,

    What you need is Cache Substitution: certain parts of the page/widget are dynamic while the rest is cached.
  3. Kris
    Kris avatar
    16 posts
    Registered:
    24 Sep 2012
    30 Jan 2014
    Link to this post

    I've looked into the Cache Substitution. However it will not work in this case. Cache Substitution is wonderful and works really well if all you are changing are stings of data. In this case I'm hiding and showing complex data with fields that bind data and code behind click events.

    I've tried using Cache Substitution and rending the entire control to a string(https://coderwall.com/p/4ajzqq), however, click events and posts back no longer work when I do that.

3 posts, 0 answered