Help needed understnading the Published Content Cache

I have a single instance of Umb 17 set up in a multi-site configuration, with each site being a root node. As the sites are all related and share a global navigation and global footer, I am creating a View Component that will access the “global information” page that is set up as a root node. It will then access the “site information” page, which is a child node of the site’s root node, and then site/global navigation as well as the site/global footer into one output.

While looking at the best ways to do this it seems that using the IUmbracoContextAccessor so I can do .Root() and .GetAtRoot() to find the settings nodes and, as it was explained to me, this is the best way to do it as it reads from the “Published Content Cache” but I can’t really find any information about that cache and it’s limitations. The umbraco instance will have over 15k nodes so my concern is that A: This is to many nodes to cache and could crash the server OR B: Umbraco HQ forsaw something like this and limits the amount of nodes in the cache so there is no longer a guarantee that the nodes I want are in the cache.

So, are either of my concerns valid? How exactly does this cache work? Is there a better way to access these nodes?

I believe Umbraco uses Microsoft’s Hybrid Cache and there are settings you can control in Umbraco. My understanding is that the “Hybrid” part comes from the fact that it keeps some cache in memory but the remainder on disk. So even large caches can “stream” effectively - see this blog.

Hi @Eaglef90

@DanDiplo is correct, v17 uses Microsoft’s Hybrid Cache under the covers, although previous versions of Umbraco also used caching to improve performance so content is read from a cache rather than hitting the database in your templates/views.

The Hybrid Cache uses lazy loading but will seed the cache based on default rules (which you can change).

Umbraco uses a lazy loaded cache, meaning content is loaded into the cache on an as-needed basis. Whenever a piece of content is shown on the website for the first time it first needs to be loaded into the cache.

You can see more details about the Hybrid Cache settings here:

If the nodes you want are not in the cache, they will be loaded when first requested.

You can read more about the cache seeding here:

Ultimately, you shouldn’t need to worry about the cache unless you are seeing performance issues or you want to include/exclude certain nodes from being seeded and added to the cache at startup.

Previous versions of Umbraco loaded everything into the cache at startup, so using the Hybrid Cache with seeding improves startup performance.

Justin

Thanks for the detailed info and links. I had read over what Dan had posted but was still unsure and about to post a follow-up, but this, I think, covers the last of my concerns. I will use the IUmbracoContextAccessor for my footer/navigation building.