Copied to clipboard

Flag this post as spam?

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


  • andy h 4 posts 24 karma points
    Aug 12, 2012 @ 21:41
    andy h
    0

    NodeFactory returns stale published data

    I am using the NodeFactory's Node class (in an external ASP.NET 4.0 MVC3 site) to retrieve published content from another Umbraco 4.8.0 site, but I am not able to see any newly updated and published content after the first read. Seems like the API caches the content upon the first read. I did verify that the updated content was published by viewing it on my Umbraco site and checking the umbraco.config. I have to restart my VS2010 development server to see the updated publish content. 

    Is there a config setting for the API to always get the latest published content? or my C# code is missing something. My C# code is as follows

     

    var node = new Node(123);

            var nodeName = node.Name;

            var bodyText = node.GetProperty(" bodyText").Value;

    Many thanks in advance

     

     

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Aug 13, 2012 @ 12:11
    Jeroen Breuer
    0

    Umbraco uses the UmbracoContext, but that has some problems: https://groups.google.com/forum/#!topic/umbraco-dev/2C5i38zQiDA%5B1-25%5D. It could be related to that. Might be better to create some webservices which return the data you need instead of trying to use the NodeFactory in an external website.

    Jeroen

  • Douglas Ludlow 210 posts 366 karma points
    Aug 13, 2012 @ 17:15
    Douglas Ludlow
    0

    I'd second the webservice idea. It's real easy to create a /base method that returns either xml or json, but you could just as easily create a wcf or asmx service as well.

  • andy h 4 posts 24 karma points
    Aug 14, 2012 @ 03:47
    andy h
    0

    Thanks Jeroen / Douglas. I will create a webservice then. Too bad that the NodeFactory doesn't return real-time updated published data, it was a joy to use it. I hope the webservice is as easy. Thanks again guys.

Please Sign in or register to post replies

Write your reply to:

Draft