Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Improving Loading-Speed of ReactJS-Portlets
Hello Liferay Friends,
I hope you all are healthy and well in these quite crazy corona-times.
Recently I tested out some use-cases for ReactJS-Portlets and noticed that they load quite slow (with Liferay Portal CE 7.2.1) .
Are there any possibilities to improve loading speed of ReactJS-Portlets?
Have a nice week,
Fredi.
I hope you all are healthy and well in these quite crazy corona-times.
Recently I tested out some use-cases for ReactJS-Portlets and noticed that they load quite slow (with Liferay Portal CE 7.2.1) .
Are there any possibilities to improve loading speed of ReactJS-Portlets?
Have a nice week,
Fredi.
I am not really a React Portlet user, but did you measure, what is slow? Do the resources take a lot of time to be loaded?
Hi Christoph,
on a Content-Page with multiple Fragments and a React Portlet between the React Portlet is loading noticable slower then all the other Fragments on the page. (Difference up to 2seconds)
Of course loading the resources takes time but like that using React Portlets means we have to make sure that there are for example Placeholder-Previews or Loading-Circles to prevent the Elements on the Page from "jumping" after the React Portlet has its full height.
Are there any advised tips or techniques to make React Portlets load faster?
on a Content-Page with multiple Fragments and a React Portlet between the React Portlet is loading noticable slower then all the other Fragments on the page. (Difference up to 2seconds)
Of course loading the resources takes time but like that using React Portlets means we have to make sure that there are for example Placeholder-Previews or Loading-Circles to prevent the Elements on the Page from "jumping" after the React Portlet has its full height.
Are there any advised tips or techniques to make React Portlets load faster?
Can you measure it with the browser developer console?
Can you create a minimal example and post it here or on github? Maybe creating the "minimal" example already helps you, because it might help you to narrow it down.
If you use the React code on a simple html page, how does it behave? Is it also slow or much faster?
Can you create a minimal example and post it here or on github? Maybe creating the "minimal" example already helps you, because it might help you to narrow it down.
If you use the React code on a simple html page, how does it behave? Is it also slow or much faster?
I am using the sample code of Liferays React Widget.
https://help.liferay.com/hc/en-us/articles/360029028051-Developing-a-React-Application
Just choose "Yes" on "Do you want to create sample code"-Option.So it's a really basic React Widget (added for testing two different pages inside the portlet with routes - nothing more) and for my understanding should not take that much time loading.
https://imgur.com/a/gssHo7T
https://help.liferay.com/hc/en-us/articles/360029028051-Developing-a-React-Application
Just choose "Yes" on "Do you want to create sample code"-Option.So it's a really basic React Widget (added for testing two different pages inside the portlet with routes - nothing more) and for my understanding should not take that much time loading.
https://imgur.com/a/gssHo7T
Hmm, I tested it now with 7.2 DXP and 7.3 CE, the plain npm portlet loads quite fast for me.
Question: When you switch between pages, is it faster or the same? I mean, create two pages, put the portlet on page1. Refresh page. Click page 2, click again page 1. Is it still slow?
One difference I see is the page size. My testpage here has 2.8 MB, yours has 16. For some reason, your page is really heavy. My guess here is that your problem is more general, not specific to the React Portlet.
Question: When you switch between pages, is it faster or the same? I mean, create two pages, put the portlet on page1. Refresh page. Click page 2, click again page 1. Is it still slow?
One difference I see is the page size. My testpage here has 2.8 MB, yours has 16. For some reason, your page is really heavy. My guess here is that your problem is more general, not specific to the React Portlet.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™