Copied to clipboard

Flag this post as spam?

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


  • Ansar 181 posts 291 karma points
    Oct 12, 2011 @ 07:18
    Ansar
    0

    UnPublish() and Cache problem - is there any workaround?

    Hi,

    The following code doesnt seems to update the cache properly and so the unpublished node is still available in the live site..

    Document doc = new Document( id );
    doc.UnPublish();
    umbraco.library.UnPublishSingleNode(doc.Id);
    umbraco.library.UpdateDocumentCache(doc.Id);

    I have checked the forums and it seems lot of other ppl reported same issue but couldnt find any solution.. is there any workaround to make this work? May be do the same operations (directly DB also if needed) what Umbraco do when a user unpublish a node from the backoffice.. 

    Any help on this will be greatlely appreciated..

    Thanks.

  • Rodion Novoselov 694 posts 859 karma points
    Oct 13, 2011 @ 23:04
    Rodion Novoselov
    0

    Hello, Anz. Does your site run on a single server or on a web-farm?

  • Ansar 181 posts 291 karma points
    Oct 14, 2011 @ 07:47
    Ansar
    0

    @Rodion - its a web farm...

  • Rodion Novoselov 694 posts 859 karma points
    Oct 14, 2011 @ 08:30
    Rodion Novoselov
    0

    Ok, so have you set the 'distributedCall' option to 'true' in the 'umbracoSettings.conf' file?

  • Ansar 181 posts 291 karma points
    Oct 14, 2011 @ 21:21
    Ansar
    0

    @Rodion - sorry the bug is even there in the local development copy.. so its not related to the load balancing..

    using

    umbraco.library.RefreshContent();

    seems working fine and refreshing the cache..

    Does it have any side effect in using huge websites with 1000s of pages?

  • Rodion Novoselov 694 posts 859 karma points
    Oct 14, 2011 @ 22:49
    Rodion Novoselov
    0

    I don't know for sure, but by some pieces of source code that I read before I would guess that Umbraco keep a copy of content cache (by default App_Data/umbraco.config) in memory and when it makes a 'small' change like updating, deleting or publishing a document it first makes this change to the in-memory copy and then flush it to the disk using a background thread. On the contrary when some 'big' change is being made like rebuilding the whole cache, umbraco makes it using a copy of the cache while the initial copy remains alive and able to serve incoming requests till the processed copy is ready. Again, it's only my speculations based on skimming over the code, and I'd also be glad to get more information from someone who could know better.

Please Sign in or register to post replies

Write your reply to:

Draft