-
Notifications
You must be signed in to change notification settings - Fork 927
Output Cache Views (Query) #543
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
Comments
Hmm. Have you tried using |
Thanks @dustinsoftware that was super helpful I did not know this was a feature. I may have to extend it to get the hydrate to happen on page load to hit some other bench marks but this will fix my output cache issue |
@feanz did you end up developing a solution for hydrating on page load? |
Yeah i used the recommended @Html.ReactWithInit method. This does require you to include react and your components scripts before the first component is rendered. This is not great for page paint speed. I created a custom React method that add the hydrate call to an array functions in js. Then I add a call at the end of the body that calls all these functions, so that we can move the react script load to the end of the body. |
@feanz can you share an example on how you did this? Struggling with the same issues. Thanks :-) |
@aventic are you observing slow rendering problems if you include your script tags first and use ReactWithInit? I think this is a scenario we should have a better story for, so gathering data for where the pain points are. |
@dustinsoftware Sorry for the late answer. Well reason is I dont want to load my script at the very top of my page. I want to load it at the bottom, so all the dom elements are ready and loaded. Sitecore is using renderings, those renderings are getting cached, therefor I did as @feanz. I created a react functions array on the Html helper method, which I then run just after my bundle is initialized in the bottom of the page. |
Re-opening this issue so we can make the caching scenario better in 5.0 |
This allows Output Caching to be used, in #543 Still needs tests and documentation updates
This allows Output Caching to be used, in #543 Still needs tests and documentation updates
This allows Output Caching to be used, in #543 Still needs tests and documentation updates
Resolved by #858 |
This is more of a query than an issue. Sorry if this is not the best place to ask. If there is a better place to raise this feel free to let me know and close the issue.
I'm using ReactJs.net on a large Sitecore Site (.net Enterprise CMS). We have created a really nice model where we integrate React frontend components to Sitecore CMS components. For those who have not used Sitecore it uses Asp.net MVC under the covers to create markup for custom components. This is where we plumb in ReactJs.net.
My question is, is it possible to support the output caching of these views with React? The current issue I am seeing is that the server side rendered markup is there and the content is visible but because the
@Html.React
call has never been made then that component is not in the Hydrate call. Then react component never initialises. This is fine for components that have not interactivity but for anything else it breaks. Does anyone have a solution for this?The text was updated successfully, but these errors were encountered: