x First time here? Check out the FAQ

Come work for Umbraco - The Umbraco HQ are hiring Project managers, .NET developers and DevOps people!

UpdateDocumentCache

    Publishes a document by adding it to the umbraco.config file, prior to this the document should be marked published by calling Document.Publish(User u) on the document object.

    Example

    //...
    using
     umbraco;
    using umbraco.cms.businesslogic.web;
    //...

    //Create new DocumentObject
    Document doc = new Document(id);
    //Mark the document for publish under Admin account
    doc.Publish(new User(0));
    //Publish the document by Updating umbraco.config file
    library.UpdateDocumentCache(doc.Id);