performance optimization to mitigate page bloat caused by Blazor serializing/encrypting state when crossing render mode boundaries

This commit is contained in:
sbwalker
2024-07-16 16:21:35 -04:00
parent 98bdfd3dbe
commit 4d26468ede
15 changed files with 145 additions and 72 deletions

View File

@ -10,6 +10,7 @@
@inject IStringLocalizer<SharedResources> SharedLocalizer
@inject IPageModuleService PageModuleService
@inject IModuleService ModuleService
@inject IPageService PageService
@if (_initialized)
{
@ -313,8 +314,9 @@
.Select(md => md.PageId)
.Distinct();
// Filter and retrieve the corresponding pages
_pagesWithModules = PageState.Pages
// retrieve the pages which contain the module
var pages = await PageService.GetPagesAsync(PageState.Site.SiteId);
_pagesWithModules = pages
.Where(pg => distinctPageIds.Contains(pg.PageId) && pg.IsDeleted == false)
.ToList();