Copied to clipboard

Flag this post as spam?

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


  • Phil Lee 4 posts 25 karma points
    Jun 10, 2011 @ 01:14
    Phil Lee
    0

    Umbraco cache vs umbracoconfig.xml - when are they updated?

    Hi there,

    This question has probably been answered completely elsewhere - if so, please point me to it.

    I've looked at http://forum.umbraco.org/yaf_postst3276_When-is-umbracoxml-generated.aspx and am still not 100% confident that the umbraco config file is only written on app restarts. I'm currently on a dev machine, and it seems to be updating everytime I publish a node. This is a concern for me, as I'm considering using a rating system for pages, with a similar structure to the Polls package, which updates/publishes a node everytime someone rates a page. If ratings happen frequently, this would mean that in production the xml file would be constantly being regenerated, which defeats the purpose of having the xml file? Is this the correct behaviour? Could it be that my IIS app pool is recycling constantly (it's only set to do this every 1740 minutes though)

    My other question is around the Umbraco in-memory cache. My understanding thus far is that it should be updated everytime a node is published, BUT only the relevant node will be updated, and not the whole cache. Is this correct? Would that also mean that there could be plenty of recently published node in the in-memory cache, but not in the xml file at any given point in time?

    The current behaviour I'm seeing is that the umbraco config file and cache seem to be getting updated at the same time (whenever a node is published) which differs from what I've read elsewhere...

    Thanks in advance!

    Phil

  • Richard Soeteman 4036 posts 12864 karma points MVP
    Jun 10, 2011 @ 01:40
    Richard Soeteman
    0

    Hi Phil,

    Basically this is what's happening. Whenever you publish/unpublish a node the internal cache is modified. When modifying the internal cache, the cache file  file (umbraco.config) is also modified by default(think in the exact same way). So the internal cache and xml file should be in sync. This umbraco.config file is only needed for a faster initial application startup. 

    In the config file /config/umbracoSettings.config you find the settingXmlCacheEnabled set this to false and the Umbraco.config file will not be updated anymore, it will take a bit longer to startup your app though.

    CHeers,

    Richard

  • Phil Lee 4 posts 25 karma points
    Jun 10, 2011 @ 03:26
    Phil Lee
    1

    Thanks Richard. That makes sense - so the umbraco xml file is only read from at application startup, but kept in sync regardless. Are you sure you don't mean the ContinouslyUpdateXmlDiskCache setting instead of XmlCacheEnabled (http://our.umbraco.org/wiki/reference/files-and-folders/files-in-the-config-folder/umbracosettingsconfig) though? According to the documentation this setting is what controls whether content is written to the xml cache when published, although again, I'm not sure if this actually means written to the file, or just the in-memory cache.

    I'd rather not disable caching altogether, however, my concern was that the Umbraco in-memory cache and xml cache were essentially the same thing, and that by publishing any node it would invalidate the whole cache, rather than just a portion of it. This would mean that if nodes are published often, which they would be in the case of Polls/reviews, the cache would get invalidated very frequently. Perhaps I need to be more clear on what the difference between the 'xml cache' and the umbraco config file actually is? Is the xml cache just a cached xml document that is pulled from the config file? Or are nodes cached on an individual basis, allowing some to be invalidated without affecting others?

Please Sign in or register to post replies

Write your reply to:

Draft