Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with OutputCache in Blazor SSR #55534

Open
1 task done
zubairkhakwani opened this issue May 5, 2024 · 1 comment
Open
1 task done

Issue with OutputCache in Blazor SSR #55534

zubairkhakwani opened this issue May 5, 2024 · 1 comment

Comments

@zubairkhakwani
Copy link

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

  1. 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.
  2. 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

@zubairkhakwani
Copy link
Author

@danroth27 @SteveSandersonMS @mkArtakMSFT I believe that addressing the issue related to Output Cache is crucial for enhancing the performance and scalability of SSR websites. Since this appears to be a solvable bug (Hopefully :D), I propose considering its resolution for inclusion in the .NET 9 release. Thank you for addressing this matter & Thank you for Blazor, Have a good day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants