Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeremy Loeckler 10 posts 52 karma points
    Aug 09, 2013 @ 18:59
    Jeremy Loeckler
    0

    ContentService SaveAndPublish Doesn't Clear CachedPartials

    Umbraco v6.1.1

    I'm using ApplicationContext.Current.Services.ContentService to programatically SaveAndPublish a node. However this doesn't seem to be resetting the CachedPartials for that particular page.

    //Controller Code Snippet

    var contentService = ApplicationContext.Current.Services.ContentService;
    var updatedContent = contentService.GetById(someNodeId);
    contentService.SaveAndPublish(updatedContent);

    //View Code Snippet

    @Html.CachedPartial("MyPartialView", Model, 3600, true, false)

     

    I don't think it's relevant to this issue, but the content for the node I'm publishing hasn't actually changed. I'm just publishing to clear the cache. If there's another way to programatically clear the cache for a specific node/page, that'd be a decent workaround (heck it'd be a superior solution).

    I appreciate your help.

Please Sign in or register to post replies

Write your reply to:

Draft