-
Couldn't load subscription status.
- Fork 10.5k
Closed
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsfeature-blazor-ssrfeature-output-cachinginvestigate
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Initially, everything functions as expected. However, upon adding the OutputCache attribute, two significant issues arise
- Script Functionality Breakdown: Upon revisiting the cached Home page, script functionality becomes non-responsive. Despite logging within the OnUpdate method, the console remains empty, indicating a failure in executing JavaScript functionality. This impedes the user experience and disrupts the intended behavior of the page.
- Excessive Reloading with Hash Navigation Furthermore, when navigating to a link within the same page containing a hash (#element), Blazor's JavaScript file (blazor.web.js) inexplicably reloads the page multiple times.
I am using BlazorPageScript nuget package provided by @MackinnonBuck to work with PageScript
If I remove @attribute [OutputCache(Duration = 2000)] it works fine.
Additionally, I've created a Video demonstrating the precise steps to replicate the issues.
untitled-video-made-with-clipchamp-1_MSVCQOmj.mp4
Expected Behavior
should works and navigating to #elements in same page should not reload pages multiple times.
Steps To Reproduce
Repo link to reproduce this issue.
minimalistic project which reproduces this issue
Exceptions (if any)
No response
.NET Version
8.0.204
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsfeature-blazor-ssrfeature-output-cachinginvestigate