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;
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.
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.
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.
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;
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
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.
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.
is working on a reply...