Copied to clipboard

Flag this post as spam?

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


  • Thomas 160 posts 335 karma points
    Jan 16, 2016 @ 18:23
    Thomas
    0

    Problem with Publish and Unpublish with XML Cache

    Hi, I am facing the following issue as soon as i update my site to 7.3.3 I have a travel news portal site in production. When i publish or unpublish a document, in the browser the document remains or not accordingly. If i publish it, the client cannot see it, and if i unpublish the document is still available in client. I check the umbraco.config file and the changes are committed. Even if i press CTRL+F5 the problem remains. In order to make it visible or not, according on the action, i have to recycle the application pool of the IIS. I tried to: 1. disable the caching in IIS but the problem remains. 2. check the application pool worker processes to see if it has more than one. It does have one and the problem remains. 3. add in umbracosettings.config the ContinouslyUpdateXmlDiskCache and XmlContentCheckForDiskChanges values to true, but the problem remains.

    It looks like umbraco does not clear the in memory cache after publishing or unpublishing a content in order to force read the xml file.

    I believe that a similar issue is on the following https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/48080-Content-cache-in-Umbraco-7

    without any solution.

    Any suggestions please because i am in production environment and i am facing a serious problem.

    Regards

    Thomas

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Jan 17, 2016 @ 00:19
    Nicholas Westby
    0

    I'm confused. Are you saying that when you try to publish or unpublish a content node, the opposite action occurs? That is:

    • When you try to publish, the content gets unpublished (i.e., it is no longer accessible).
    • When you try to unpublish, the content gets published (i.e., it becomes visible).

    If so, that is a very strange problem. Are you using output caching or donut caching? What are the HTTP response codes when you refresh the page (e.g., HTTP 200 for success or HTTP 304 for not modified)? Do you see the CPU load on your server increase when you refresh a page? Are you able to replicate the problem locally, or is this just a problem on the production server? Are you using load balancing? When you say "client", do you mean web browser or a person you are doing business with?

  • Thomas 160 posts 335 karma points
    Jan 17, 2016 @ 07:13
    Thomas
    0

    Nicholas no. Let me explain.

    • When i publish a new content, in the frontend web browser the content is not visible, but the umbraco.config file has been updated and the content exists there. In order to make it visible i have to recycle the application pool.
    • When i unpublish a content which was visible in frontend web browser, it remains visible, but the umbraco.config file has been updated and the content does not exists there. In order to make it not accessible i have to recycle the application pool.

    It looks like the in memory cache is not getting cleared after publish or unpublish action in order to force read the xml file again.

    About the IIS caching you asked for. I am not use caching for the folder App_Data. I have disable both user cache and kernel cache.

    The HTTP responses i am getting are 301 and 200.

    The CPU load is 2% or 3%

    I can replicate the same problem also in my dev environment either by using IIS Express or local IIS. I was trying to fix the problem first in my dev environment and then publish it in production, unfortunately without success.

    I am not using load balancing, it is one server.

    When i say "client" i mean the frontend web browser.

    Regards

    Thomas

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Jan 17, 2016 @ 09:00
    Nicholas Westby
    0

    That is strange that you are getting an HTTP 301. That is a redirect. If the content is published, you should get an HTTP 200. If the content is not published, you should get an HTTP 404.

    Do you have packages installed? In particular, I'm curious if you have any packages installed that perform URL redirection.

    Are you doing anything custom to perform redirects?

    Are there any errors in your Umbraco log when you publish or unpublish?

    By the way, I have no idea what this means:

    About the IIS caching you asked for. I am not use caching for the folder App_Data. I have disable both user cache and kernel cache.

    One would not typically deal with the App_Data folder for output caching. Typically, output caching is specified on controllers/action methods and with web.config settings.

  • Thomas 160 posts 335 karma points
    Jan 17, 2016 @ 11:50
    Thomas
    0

    Sorry, you mean HTTP Request from backend. From backend i am getting HTTP Response 200.

    There are no errors in Umbraco Log.

    The installed packages are:

    1. Belle Icon Pack
    2. FALM Housekeeping
    3. ImageGen
    4. uLogs
    5. Umbraco Forms

    I will get crazy with this situation. I cannot find a resolution ...

  • Thomas 160 posts 335 karma points
    Jan 17, 2016 @ 17:19
    Thomas
    2

    Well i found a solution. Firstly i upgrade the umbraco from version 7.3.3 to 7.3.5. The upgrade in development environment with IIS Express finally works and the content in frontend browser getting refreshed accordingly the backend actions. Then i upgrade the production environment. In production now i had again the same issue but because of the development environment i thought that i had to change the configuration of the IIS. So i open the IIS Manager, i had select the application, i open the Output Cache and i had uncheck the User Cache option. After that it looks that everything is working.

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Jan 17, 2016 @ 17:53
    Nicholas Westby
    0

    Glad to hear you got it working :-)

  • Thomas 160 posts 335 karma points
    Jan 20, 2016 @ 07:34
    Thomas
    0

    Unfortunately i was wrong. I didn't got it working. I thought so, but today i publish one new document and it is not available in frontend. I am confused. I have to find solution instead of recycling the IIS Application Pool all the time.

    Any help please?????

  • Thomas 160 posts 335 karma points
    Jan 20, 2016 @ 07:49
    Thomas
    0

    Following is the records from the log file when i publish the content. As you can see there is no errors. The content has been published and the umraco.content has been loaded the content from xml. But the in-memory cache still does not load the new content in frontend in order to make it available for the public.

    In the log you will see two or three times the content publishing, saving in xml and loading from xml because i tried two or three times to publish it and make it available in frontend, unsuccessful.

    2016-01-20 09:21:32,008 [P153164/D2/T155] INFO Umbraco.Core.Publishing.PublishingStrategy - Content 'Από πού πήραν το όνομά τους τα 3-5 Πηγάδια' with Id '0' has been published.

    2016-01-20 09:21:32,493 [P153164/D2/T155] INFO Umbraco.Core.Publishing.PublishingStrategy - Content '2016' with Id '0' has been published.

    2016-01-20 09:21:32,587 [P153164/D2/T155] INFO umbraco.content - Loading content from database...

    2016-01-20 09:21:33,196 [P153164/D2/T155] INFO Umbraco.Core.Publishing.PublishingStrategy - Content '01' with Id '0' has been published.

    2016-01-20 09:21:33,274 [P153164/D2/T155] INFO umbraco.content - Loading content from database...

    2016-01-20 09:21:33,758 [P153164/D2/T155] INFO Umbraco.Core.Publishing.PublishingStrategy - Content '20' with Id '0' has been published.

    2016-01-20 09:21:33,821 [P153164/D2/T155] INFO umbraco.content - Loading content from database...

    2016-01-20 09:21:34,462 [P153164/D2/T155] INFO Umbraco.Core.Publishing.PublishingStrategy - Content 'Από πού πήραν το όνομά τους τα 3-5 Πηγάδια' with Id '9677' has been published.

    2016-01-20 09:21:34,634 [P153164/D2/T155] INFO umbraco.content - Loading content from database...

    2016-01-20 09:21:35,118 [P153164/D2/T155] INFO Umbraco.Core.Publishing.PublishingStrategy - Content 'Από πού πήραν το όνομά τους τα 3-5 Πηγάδια' with Id '9677' has been published.

    2016-01-20 09:21:35,290 [P153164/D2/T155] INFO umbraco.content - Loading content from database...

    2016-01-20 09:21:36,041 [P153164/D2/T155] INFO umbraco.content - Loading content from database...

    2016-01-20 09:21:40,636 [P153164/D2/T62] INFO umbraco.content - Save Xml to file...

    2016-01-20 09:21:40,933 [P153164/D2/T35] INFO umbraco.content - Saved Xml to file.

    2016-01-20 09:21:58,970 [P153164/D2/T95] INFO umbraco.content - Load Xml from file...

    2016-01-20 09:21:59,016 [P153164/D2/T95] INFO umbraco.content - Loaded Xml from file.

    2016-01-20 09:22:26,555 [P153164/D2/T64] INFO umbraco.content - Loading content from database...

    2016-01-20 09:22:31,171 [P153164/D2/T87] INFO umbraco.content - Save Xml to file...

    2016-01-20 09:22:31,343 [P153164/D2/T22] INFO umbraco.content - Saved Xml to file.

    2016-01-20 09:22:31,781 [P153164/D2/T92] INFO umbraco.content - Load Xml from file...

    2016-01-20 09:22:31,906 [P153164/D2/T92] INFO umbraco.content - Loaded Xml from file.

    2016-01-20 09:24:09,831 [P153164/D2/T58] INFO Umbraco.Core.Publishing.PublishingStrategy - Content 'Από πού πήραν το όνομά τους τα 3-5 Πηγάδια' with Id '9677' has been published.

    2016-01-20 09:24:09,971 [P153164/D2/T58] INFO umbraco.content - Loading content from database...

    2016-01-20 09:24:14,691 [P153164/D2/T33] INFO umbraco.content - Save Xml to file...

    2016-01-20 09:24:14,863 [P153164/D2/T54] INFO umbraco.content - Saved Xml to file.

    2016-01-20 09:24:20,524 [P153164/D2/T76] INFO umbraco.content - Load Xml from file...

    2016-01-20 09:24:20,743 [P153164/D2/T76] INFO umbraco.content - Loaded Xml from file.

  • Stephen 767 posts 2273 karma points c-trib
    Jan 20, 2016 @ 09:15
    Stephen
    0

    Just to be sure: is this the same load-balanced environment you describe in the other post?

    Assuming it is not... there should be no need to change anything in umbracoSettings.config. What's weird is that umbraco.config contains a direct dump of the in-memory Xml cache, so in theory what you see in umbraco.config is what you get on the site.

    Also weird: the log exerpt that you copied contains many lines reading "Loading content from database..."--which means Umbraco keeps trying to re-read the entire content Xml from database. Why would it not use the umbraco.config file?

  • Thomas 160 posts 335 karma points
    Jan 20, 2016 @ 09:22
    Thomas
    0

    You are assuming correct. this is not the same environment as the other post. Regarding the umbraco.config file, i have read on a documentation in the web (i cannot remember where), that the in-memory xml cache is getting data from the umbraco.config file. I am assuming that the file is getting update after the database update and then the in-memory xml cache i believe that is getting cleared in order the next time someone asks for content to force read the xml file. Is that correct? So in my situation, i believe that the in-memory cache is not getting cleared and keeps the old data.

    As for the "Loading content from database...", this is happening because when i publish a new content an autoFolder code is running to create Year-Month-Day folders and then add the new content under the published day. You can see in the last 6 lines of the log that it was a retry to re publish the content in order to make it available in frontend, and umbraco has tried to load the content from database once.

  • Thomas 160 posts 335 karma points
    Jan 20, 2016 @ 09:26
    Thomas
    0

    And if that helps, how do i retrieve the content in frontend?

    Firstly, in order to explain, i have another umbraco site v7.1.8 on the same server with the same configuration, without having such a problem.

    So, On the site that i have the problem v7.3.5, i am getting the content by retrieving first the parent Node (the category under the articles exists) and then from the parent Node i am using the function "GetDescendantNodesByType". This function returns the correct Nodes of the type i am searching for, but when i publish or unpublish content from backend, this function returns the old cached content and i have to restart the application pool in order for the function to return the correct updated content.

    On the site that i am not facing such an issue v7.1.8, i am retrieving again the parent Node (the category under the articles exists) but instead of using the function "GetDescendantNodesByType" i am enumerating the child nodes with a foreach statement and checking there the NodeTypeAlias property if is equal with the alias i am searching for and return only those nodes. I thought that the function "GetDescendantNodesByType" is much faster than executing a foreach statement and i used it on the new site.

  • Stephen 767 posts 2273 karma points c-trib
    Jan 20, 2016 @ 10:08
    Stephen
    0

    I am assuming that the file is getting update after the database update and then the in-memory xml cache i believe that is getting cleared in order the next time someone asks for content to force read the xml file. Is that correct?

    No. It works the other way round. When the cache is notified that a content has changed (after the database update) then the in-memory Xml cache is refreshed. Then from time to time, it is flushed to disk.

    As for the "Loading content from database...", this is happening because [...]

    But it should not happen. Content should be loaded from umbraco.config, that's the purpose of that file: to avoid hitting the database when the app starts. If you delete the umbraco.config file, then you should see "Loading content from database", once, and that is it.

    Then...

    GetDescendantNodesByType is an extension method of the INode type... which is something that is obsolete and should not be used anymore. It is quite possible that it suffers from some caching issues.

    How are you retrieving the parent "node"? It should be fairly simple to migrate to the proper way of getting content (ie, IPublishedContent objects).

  • Thomas 160 posts 335 karma points
    Jan 20, 2016 @ 10:22
    Thomas
    0

    But it should not happen. Content should be loaded from umbraco.config, that's the purpose of that file: to avoid hitting the database when the app starts. If you delete the umbraco.config file, then you should see "Loading content from database", once, and that is it.

    Is this happening probably because i have in umbracosettings.config the following properties true?

    • ContinouslyUpdateXmlDiskCache = true
    • XmlContentCheckForDiskChanges = true

    GetDescendantNodesByType is an extension method of the INode type... which is something that is obsolete and should not be used anymore. It is quite possible that it suffers from some caching issues.

    Is there any sample to see how to retrieve all the articles under the category node using the IPublishedContent?

    The category node you asked for i am getting it from the root node of the site, again using the function "GetDescendantNodesByType" with a "Where" the document property "categorySlug" equals to a uniqueInternalName (a name per category i am using it as unique identifier).

  • Stephen 767 posts 2273 karma points c-trib
    Jan 20, 2016 @ 10:35
    Stephen
    0

    Not sure about the umbracoSettings.config - just restore the options to their default values.

    Assuming the "root node of the site" is the first top node in the tree...

    var root = Umbraco.TypedContentAtRoot().First();
    

    Then your category would be

    var cat = root.Descendants("categoryNodeTypeAlias")
        .Where(x => x.GetPropertyValue<string>("categorySlug") == categoryName);
    

    And the articles would be

    var arts = cat.Descendants("articleNodeTypeAlias");
    

    And you can foreach on that variable.

    Making sense?

  • Thomas 160 posts 335 karma points
    Jan 20, 2016 @ 10:38
    Thomas
    0

    That makes sense. I will try to update the source code of the site and i will reply with the results.

    Many thanks for the help.

    Thomas

  • Thomas 160 posts 335 karma points
    Jan 23, 2016 @ 19:35
    Thomas
    0

    Well,

    As i promise, i follow stephen's comments regarding how to retrieve content using the new IPublishedContent instead of using the GetDescentantNodesByType which is extention method of INode and may have problems with cache, i update my code and now it looks like on publish and unpublish the content in frontend works as expected.

    But again i cannot understand why the umbraco.NodeFactory does not have problems with the cache in version 7.1.8 and i am absolutely sure about that because i have a production environment in that version in which i am using NodeFactory to retrieve and show content in frontend, and it works. I believe that a combatibility broken issue occured somewhere between 7.1.8 and the next versions with the caching and the NodeFactory.

  • Jordan Lane 28 posts 130 karma points c-trib
    Jan 21, 2016 @ 11:06
    Jordan Lane
    0

    Just to confirm I'm also seeing this behavior when running through IIS Express on 7.3.4

  • Stephen 767 posts 2273 karma points c-trib
    Jan 21, 2016 @ 11:13
    Stephen
    0

    Just to confirm: what you are seeing is that you can publish/unpublish some documents, and the umbraco.config file is updated accordingly, yet the changes are not reflected on the front-end. Is that correct?

    When that happens, any chance you can have a view that would dump the output of

     umbraco.content.Instance.XmlContent.OuterXml
    

    ie the content of the actual, in-memory, content cache -- so we can check whether it is identical to what's in umbraco.config, and whether it reflects the changes that you have done?

  • Jordan Lane 28 posts 130 karma points c-trib
    Jan 21, 2016 @ 11:32
    Jordan Lane
    0

    Yeah that's exactly right Stephen.

    So this is the process I did to recreate it accurately:

    -> Go to a document type composition and add a new property 
    -> Go to a node that is composed of that document type 
    -> Add some content in the new property
    -> Save and publish 
    -> Output field in view and nothing appears
    

    Checking the umbraco.config the property and content are there as expected:

    <Page id="1061" key="37696ac5-2e5d-4de7-a306-cc2456e4555a" parentID="1051" level="2" creatorID="0" sortOrder="1" createDate="2016-01-20T17:11:45" updateDate="2016-01-21T11:20:44" nodeName="Privacy" urlName="privacy" path="-1,1051,1061" isDoc="" nodeType="1057" creatorName="Admin" writerName="Admin" writerID="0" template="1056" nodeTypeAlias="Page">
      <newproperty><![CDATA[testing this new property]]></newproperty>
      <bodyText><![CDATA[<p>Privacy content here many thanks</p>]]></bodyText>
    </Page>
    

    Following your suggestion here is the node in the output of umbraco.content.Instance.XmlContent.OuterXml:

    <Page id="1061" key="37696ac5-2e5d-4de7-a306-cc2456e4555a" parentID="1051" level="2" creatorID="0" sortOrder="1" createDate="2016-01-20T17:11:45" updateDate="2016-01-21T11:20:44" nodeName="Privacy" urlName="privacy" path="-1,1051,1061" isDoc="" nodeType="1057" creatorName="Admin" writerName="Admin" writerID="0" template="1056" nodeTypeAlias="Page">
        <newproperty><![CDATA[testing this new property]]></newproperty>    
        <bodyText><![CDATA[<p>Privacy content here many thanks</p>]]></bodyText>
     </Page>
    

    This is what I have in the view with the bodyText being shown as expected but neither of the newproperty:

    @Umbraco.Field("bodyText")
    @Umbraco.Field("newproperty")
    @Model.Content.GetPropertyValue("newproperty")
    
  • Stephen 767 posts 2273 karma points c-trib
    Jan 21, 2016 @ 12:11
    Stephen
    0

    Aha, interesting things here: the in-memory cache does know about the value, and the node is published or unpublished -- only, the value of the new property is not there. Correct?

    That's a bit different from the original issue of this thread, which IIC was that the entire node would not be published or unpublished properly.

    If we can narrow it down to some (new) properties not beeing shown, then that may indicate an issue with content types not beeing properly refreshed.

    Can others comment on this thread so we can narrow the issue?

  • Jordan Lane 28 posts 130 karma points c-trib
    Jan 21, 2016 @ 15:43
    Jordan Lane
    0

    Ah sorry I didn't realise, I have checked and it is the same situation with publishing/unpublishing however.

    I went to the node and unpublished, as can be seen here:

    Unpublished node

    Then when I navigate to the URL /learn it still renders the learn template however the model is the Home node and outputting Model.Content.Id returns me the Home node ID rather than the Learn ID. Here is the umbraco.content.Instance.XmlContent.OuterXml:

    <?xml version="1.0" encoding="utf-8"?><!DOCTYPE root[ <!ELEMENT Content ANY> <!ATTLIST Content id ID #REQUIRED> <!ELEMENT Header ANY> <!ATTLIST Header id ID #REQUIRED> <!ELEMENT SEO ANY> <!ATTLIST SEO id ID #REQUIRED> <!ELEMENT Home ANY> <!ATTLIST Home id ID #REQUIRED> <!ELEMENT Learn ANY> <!ATTLIST Learn id ID #REQUIRED> <!ELEMENT Page ANY> <!ATTLIST Page id ID #REQUIRED> <!ELEMENT Settings ANY> <!ATTLIST Settings id ID #REQUIRED> ]><root id="-1"><Home id="1051" key="02b75b3c-16a5-46e1-90ca-7f95a158e7e4" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2016-01-18T20:26:38" updateDate="2016-01-21T10:57:31" nodeName="Home (en)" urlName="home-en" path="-1,1051" isDoc="" nodeType="1049" creatorName="Admin" writerName="Admin" writerID="0" template="1048" nodeTypeAlias="Home"><metaTitle><![CDATA[Home]]></metaTitle><headerBackground>1060</headerBackground><headerTitle><![CDATA[BECAUSE YOU’RE COMMITTED TO PROVIDING THE BEST CARE TO PETS]]></headerTitle><Settings id="1054" key="76bf4d23-acef-4eed-a805-3d6bc281034d" parentID="1051" level="2" creatorID="0" sortOrder="0" createDate="2016-01-19T11:47:36" updateDate="2016-01-21T11:13:19" nodeName="Site Settings" urlName="site-settings" path="-1,1051,1054" isDoc="" nodeType="1053" creatorName="Admin" writerName="Admin" writerID="0" template="0" nodeTypeAlias="Settings"><footerNavigation><![CDATA[1051,1061,1062]]></footerNavigation><disclaimer><![CDATA[* Bravecto Chew is effective against Rhipicephalus sanguineus (brown dog tick) for 8 weeks after dosing. The most common adverse reactions were mild and short-lived vomiting, decreased appetite, diarrhea and drooling. For complete safety information, refer to the product label. complete test]]></disclaimer></Settings><Page id="1061" key="37696ac5-2e5d-4de7-a306-cc2456e4555a" parentID="1051" level="2" creatorID="0" sortOrder="1" createDate="2016-01-20T17:11:45" updateDate="2016-01-21T11:48:19" nodeName="Privacy" urlName="privacy" path="-1,1051,1061" isDoc="" nodeType="1057" creatorName="Admin" writerName="Admin" writerID="0" template="1056" nodeTypeAlias="Page"><newproperty><![CDATA[testing this new property df]]></newproperty><bodyText><![CDATA[<p>Privacy content here many thanks there</p>]]></bodyText></Page><Page id="1062" key="a1935338-a6c0-4918-92d9-6e12b6b8e14c" parentID="1051" level="2" creatorID="0" sortOrder="2" createDate="2016-01-20T18:39:03" updateDate="2016-01-20T23:05:12" nodeName="Terms + Conditions" urlName="terms-plus-conditions" path="-1,1051,1062" isDoc="" nodeType="1057" creatorName="Admin" writerName="Admin" writerID="0" template="1056" nodeTypeAlias="Page"><bodyText><![CDATA[<p>Terms + Conditions content</p>]]></bodyText></Page></Home></root>
    

    It also doesn't appear in the umbraco.config:

    <root id="-1">
      <Home id="1051" key="02b75b3c-16a5-46e1-90ca-7f95a158e7e4" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2016-01-18T20:26:38" updateDate="2016-01-21T10:57:31" nodeName="Home (en)" urlName="home-en" path="-1,1051" isDoc="" nodeType="1049" creatorName="Admin" writerName="Admin" writerID="0" template="1048" nodeTypeAlias="Home">
        <metaTitle><![CDATA[Home]]></metaTitle>
        <headerBackground>1060</headerBackground>
        <headerTitle><![CDATA[BECAUSE YOU’RE COMMITTED TO PROVIDING THE BEST CARE TO PETS]]></headerTitle>
        <Settings id="1054" key="76bf4d23-acef-4eed-a805-3d6bc281034d" parentID="1051" level="2" creatorID="0" sortOrder="0" createDate="2016-01-19T11:47:36" updateDate="2016-01-21T11:13:19" nodeName="Site Settings" urlName="site-settings" path="-1,1051,1054" isDoc="" nodeType="1053" creatorName="Admin" writerName="Admin" writerID="0" template="0" nodeTypeAlias="Settings">
          <footerNavigation><![CDATA[1051,1061,1062]]></footerNavigation>
          <disclaimer><![CDATA[* Bravecto Chew is effective against Rhipicephalus sanguineus (brown dog tick) for 8 weeks after dosing. The most common adverse reactions were mild and short-lived vomiting, decreased appetite, diarrhea and drooling. For complete safety information, refer to the product label. complete test]]></disclaimer>
        </Settings>
        <Page id="1061" key="37696ac5-2e5d-4de7-a306-cc2456e4555a" parentID="1051" level="2" creatorID="0" sortOrder="1" createDate="2016-01-20T17:11:45" updateDate="2016-01-21T11:48:19" nodeName="Privacy" urlName="privacy" path="-1,1051,1061" isDoc="" nodeType="1057" creatorName="Admin" writerName="Admin" writerID="0" template="1056" nodeTypeAlias="Page">
          <newproperty><![CDATA[testing this new property df]]></newproperty>
          <bodyText><![CDATA[<p>Privacy content here many thanks there</p>]]></bodyText>
        </Page>
        <Page id="1062" key="a1935338-a6c0-4918-92d9-6e12b6b8e14c" parentID="1051" level="2" creatorID="0" sortOrder="2" createDate="2016-01-20T18:39:03" updateDate="2016-01-20T23:05:12" nodeName="Terms + Conditions" urlName="terms-plus-conditions" path="-1,1051,1062" isDoc="" nodeType="1057" creatorName="Admin" writerName="Admin" writerID="0" template="1056" nodeTypeAlias="Page">
          <bodyText><![CDATA[<p>Terms + Conditions content</p>]]></bodyText>
        </Page>
      </Home>
    </root>
    

    If I then go and republish the Learn page and refresh, the correct ID is returned along with the expected content. Interesting!

  • Stephen 767 posts 2273 karma points c-trib
    Jan 21, 2016 @ 15:52
    Stephen
    0

    That's again a different issue ;-) The Learn page is correctly unpublished and removed from the in-memory cache. However... the "/learn" url does not correspond to any document, and therefore another feature of Umbraco triggers, which is that the last part of the url can be a template. So, here, "/" maps to the home page and "learn" picks the Learn template. End result: displays the home page with the learn template.

    Which is obviously weird... but expected. There is a way (I think) to disable this "alternate template" feature.

  • Jordan Lane 28 posts 130 karma points c-trib
    Jan 21, 2016 @ 15:56
    Jordan Lane
    0

    Oh yes I'm an idiot! Ok so I can't recreate the publish/unpublish without more details from @Thomas, but there is definitely something a bit funky with the new content not displaying. Sorry Stephen!

  • Richard Thompson 100 posts 336 karma points
    Jan 21, 2016 @ 16:51
    Richard Thompson
    0

    I don't know if this is related but I have a console app which is using the content service to add new nodes and update properties on existing nodes.

    When I have created the node or updated the node I call SaveAndPublishWithStatus passing the created/updated node.

    I can see the new/updated nodes in the back office but the cache in umbraco.config isn't updated so the new data doesn't show on the site.

  • Jordan Lane 28 posts 130 karma points c-trib
    Jan 21, 2016 @ 16:55
    Jordan Lane
    0

    I think that might be a bit different, have you tried calling:

    contentService.RePublishAll();
    
  • Stephen 767 posts 2273 karma points c-trib
    Jan 21, 2016 @ 16:55
    Stephen
    0

    It somewhat is related: the console app has no way to tell the website to refresh its cache. So the content is modified in the database, but the website does not know it. You'd need to refresh the content cache entirely on the website to see the result.

    (in other words, you are load-balancing between a console and a website, and that does not work)

  • Stephen 767 posts 2273 karma points c-trib
    Jan 21, 2016 @ 16:57
    Stephen
    0

    that would only work if you run RePublishAll on the website not in the console app - you need to tell the website to refresh its caches

    it may become easier to setup such a load-balanced scenario in version >= 7.3 but I've never tried it

  • Richard Thompson 100 posts 336 karma points
    Jan 21, 2016 @ 17:04
    Richard Thompson
    0

    I've tried contentService.RePublishAll(); and a number of options I found but with no success.

    Republishing all within the back office works but I'm trying to automate the regular import of content, so I'd really like an automated solution that doesn't involve somebody having to manually republish the site.

    So there is no way to force the website to clear its cache from a console app or the content service?

  • Jordan Lane 28 posts 130 karma points c-trib
    Jan 21, 2016 @ 17:05
    Jordan Lane
    0

    Good point Stephen. Have you any idea about the property issue? I've just tried something else, if I add the property directly to the document type it works as expected.

    This seems to me like when you add properties to document type compositions, it doesn't update correctly the nodes that use that composition when rendering?

  • Jeppe Agger 1 post 71 karma points
    Aug 25, 2016 @ 10:21
    Jeppe Agger
    0

    Hi all,

    I'm sorry for digging up this old post, but I'm experiencing the exact same issue as OP.

    I have a root node called "Website" and when I add a new child node to this, it's not published until the application has been recycled.

    The "umbraco.config" file contains the newly created node, and it's also present in the in-memory cache umbraco.content.Instance.XmlContent.OuterXml that Stephen mentioned.

    However, when I access the root node from code like var root = UmbracoContext.Current.PublishedContentRequest.PublishedContent.AncestorOrSelf(1), it does not contain the new node in its Children collection.

    For some reason, the root node seems to cache its node tree and this cache is not updated along with the other xml caches. I can see that the internal variable "_xmlNode" of the root node does not contain the new node and this is apparently not reloaded. I assume this is reason for the issue.

    I have tried clicking "Republish entire site" from the backoffice, but that has no effect. The only reliable way to get the new node shown is to recycle the application.

    Currently, I'm on Umbraco 7.3.7.

    Regards Jeppe

  • Stephen Brewer 9 posts 31 karma points
    Dec 19, 2016 @ 16:21
    Stephen Brewer
    0

    Did anyone ever conclude in regard to cache not clearing?

    We are seeing inconsistencies between methods Ancestors(), AncestorsOrSelf() and Siblings and the data within. Some values are getting updated whilst others arent.

    Umbraco version 7.4.3 assembly: 1.0.5948.18141

    Steve

Please Sign in or register to post replies

Write your reply to:

Draft