Closed ParsaGachkar closed 10 months ago
@pournasserian there are multiple solutions to avoid double call for OnInitialized
CSR
frameworks Angular, React, Vue don't have SSR
enabled and yet they work perfectly fine as private access Admin Panels that don't need SSR
. but it's not good for Crawler Bots and SEO
so our Public Pages absolutely need SSR
.OnAfterRender(bool isFirstRender)
and ignore OnInitialized
as it is guaranteed by the signature.@ParsaGachkar please implement based on the third solution. Then we will review that.
@pournasserian there is a problem after removing the second call by checking IHttpContextAccessor.HttpContext.Response.HasStarted
all values that were being set in OnInitialized
were null
! so, i took a hybrid approach of solutions 1 and 3!
OnPreRendering
method definition to avoid duplicate call of our db
logicOnPreRendering
OnInitialized
callMemoryCachedValueAttribute
to ease the process (avoid storing and restoring all properties of Component)
EditForm
toTextHtmlEditPlugin.razor
TextHtmlEditPlugin
'sInitialization