Copied to clipboard

Flag this post as spam?

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


  • pnr 131 posts 226 karma points
    Oct 03, 2017 @ 08:10
    pnr
    0

    Slow refresh of cache after deleting a node

    Hi

    After deleting a node with the API I am using umbraco.library.RefreshContent() to refresh the cache, but RefreshContent takes about 10 seconds to refresh the cache. Is there another way to refresh the cache? or just to remove the deleted node from the cache?

    Thanks very much in advance :-)

  • Nick 34 posts 127 karma points
    Oct 03, 2017 @ 08:33
    Nick
    0

    Hey

    You shouldn't need to call "umbraco.library.RefreshContent()" to refresh the content. That is an old method. When you delete the content node using the umbraco content service it should refresh the cache automatically for you.

    Alternatively you could unpublish the node instead and then delete and may speed things up for you.

  • pnr 131 posts 226 karma points
    Oct 03, 2017 @ 11:19
    pnr
    0

    Hi nick

    Thanks very much for your reply!

    If I don't call "umbraco.library.RefreshContent()", the node isn't removed from from the cache :-/ I have tried to unpublish before I delete the node, but it is still not removed from the cache.

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Oct 04, 2017 @ 10:25
    Alex Skrypnyk
    100

    Hi Prn

    I'm sure that you don't need to republish all cache after deletion of one node.

    Try to unpublish the node before deletion with "UnPublish" method:

    ApplicationContext.Services.ContentService.UnPublish(contentItem);
    

    Thanks,

    Alex

  • pnr 131 posts 226 karma points
    Oct 04, 2017 @ 11:10
    pnr
    1

    Hi Alex

    It performe much better :-)

    Thanks very much !

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Oct 04, 2017 @ 17:28
    Alex Skrypnyk
    0

    Glad to help you! Have a great evening.

Please Sign in or register to post replies

Write your reply to:

Draft