diff --git a/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs b/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs index ec8614f074..dbe354d95b 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs @@ -650,7 +650,7 @@ namespace Umbraco.Web.PublishedCache.NuCache return ok; } - public bool SetAll(IEnumerable kits, bool fromLocalDb = false) + public bool SetAll(IEnumerable kits) { var lockInfo = new WriteLockInfo(); var ok = true; @@ -675,8 +675,7 @@ namespace Umbraco.Web.PublishedCache.NuCache _logger.Debug($"Set {kit.Node.Id} with parent {kit.Node.ParentContentId}"); SetValueLocked(_contentNodes, kit.Node.Id, kit.Node); - // don't refresh _localDb if we are reading from _localDb - if (!fromLocalDb && _localDb != null) RegisterChange(kit.Node.Id, kit); + if (_localDb != null) RegisterChange(kit.Node.Id, kit); AddNodeLocked(kit.Node, parent); _xmap[kit.Node.Uid] = kit.Node.Id; diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.ContentNodeKitSerializer.cs b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.ContentNodeKitSerializer.cs index 4303f97d3c..142a2c36db 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.ContentNodeKitSerializer.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.ContentNodeKitSerializer.cs @@ -41,6 +41,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource PrimitiveSerializer.String.WriteTo(value.Node.Path, stream); PrimitiveSerializer.Int32.WriteTo(value.Node.SortOrder, stream); PrimitiveSerializer.Int32.WriteTo(value.Node.ParentContentId, stream); + //TODO: Why don't we write the FirstChildContentId + NextSiblingContentId? Then we can entirely avoid all overhead when loading on startup? PrimitiveSerializer.DateTime.WriteTo(value.Node.CreateDate, stream); PrimitiveSerializer.Int32.WriteTo(value.Node.CreatorId, stream); PrimitiveSerializer.Int32.WriteTo(value.ContentTypeId, stream); @@ -54,4 +55,4 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource DataSerializer.WriteTo(value.PublishedData, stream); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs index 068d47a004..5c6dc3d252 100755 --- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs @@ -350,8 +350,9 @@ namespace Umbraco.Web.PublishedCache.NuCache _localContentDb?.Clear(); // IMPORTANT GetAllContentSources sorts kits by level + //TODO: We should sort by level + sort order and then we can use SetAllFastSorted var kits = _dataSource.GetAllContentSources(scope); - return _contentStore.SetAll(kits, false); + return _contentStore.SetAll(kits); } } @@ -425,6 +426,7 @@ namespace Umbraco.Web.PublishedCache.NuCache _logger.Debug("Loading media from database..."); // IMPORTANT GetAllMediaSources sorts kits by level + //TODO: We should sort by level + sort order and then we can use SetAllFastSorted var kits = _dataSource.GetAllMediaSources(scope); return _mediaStore.SetAll(kits); }