Message Boards
Google PageSpeed
Google PageSpeed
Regular Member Posts: 166 Join Date: 7/23/12 Recent PostsHi,
I tried to test pagespeed for liferay.com, but it seems to have a really bad score on mobile
How can we reduce the number of request?
I saw a good article here https://blog.savoirfairelinux.com/en-ca/2018/how-to-create-a-light-and-fast-loading-theme-using-liferay-portal/. I installed mod_pagespeed module, which actually helped to improve. But, it seems like there is lot more room to improve. I did encounter some error, when try to defer javascript using mod_pagespeed like the svg4everybody script was broken. Are there any suggestions on how to improve Google PageSpeed score as there are some clients who rely on these.
Regards,
Arun
RE: Google PageSpeed
Liferay Legend Posts: 14916 Join Date: 9/2/06 Recent Postsblah. I hate these kinds of things...
"oh my site has low pagespeed rankings". Pagespeed is designed to test static content sites to ensure they are optimized for mobile rendering, simple sites with minimal dynamic aspects.
Liferay, however, with roles, permissions, dynamic content, etc is not going to conform to these rules. Pagespeed testing, ranking and optimization are simply a bad application of a wrong tool for the job.
Even the referenced link points out that they could only create a super lightweight theme for the guest user (the user with typically no real dynamic aspects); as soon as you log in and especially when you are an admin, they needed the "theme switcher" concept to restore the normal Liferay code so the dynamic aspects of the site would be functional.
The bottom line is, for static sites or sites with minimal dynamic aspects, pagespeed analysis is appropriate and can help with page load times.
But for a full fledged CMS with lots of dynamic aspects, javascript frameworks for functionality, pagespeed rankings are going to difficult if not impossible to reach.
RE: Google PageSpeed
Regular Member Posts: 166 Join Date: 7/23/12 Recent Posts"oh my site has low pagespeed rankings".
Exactly, this is what the client has to say. You say its the "wrong tool for the job", what is the right tool?
You are not really right about the use on static sites only. We have really improved pagespeed score on previous versions of Liferay without breaking anything while being completely dynamic. Also, competions like Drupal (From https://www.gartner.com/reviews/market/horizontal-portals/vendor/liferay/alternatives) does better job in this area and these are the references from clients when we propose Liferay.
RE: Google PageSpeed
Liferay Legend Posts: 14916 Join Date: 9/2/06 Recent PostsThe drupal home page is another bad example. It is not dynamic either, it's their brochure site and, as such, it is fairly static and therefore can be "fake" optimized to appear to be fast when, as we all know, the dynamic versions fall way below this number.
So again, I still hate this kind of evaluation because folks that don't know better will find this and say "ooh, drupal is so much faster than liferay" but the reality is that is pretty much BS. It's like the way graphics card manufacturers would specifically build their cards and write their drivers to artificially score higher numbers from the benchmarking tools. Not because one card was actually better than another, but more because they knew that the marketing aspect of saying "we are X better than the competition," regardless of how small or meaningless X was, could sway some decision makers.
Pagespeed then becomes the same tool to artificially adjust numbers that, in the end, do not provide a real measure about site performance, it is just an artificial bar to use to appear to be better than some other site.
If, however, you want to have a general discussion about how to improve performance, that is something that has value and merit for all.
So, pagespeed aside, what Savoir Faire did is one solid approach; the idea is to lighten the "guest" theme complexity but leave the authenticated theme as-is. Using a "theme switch" is one approach, the other is to rebalance the javascript.barebone.files and javascript.everything.files (in portal-ext.properties) along with leveraging the theme's "isSignedIn()" to restrict what is done for guest users.
Another option is to leverage caching to improve performance: https://community.liferay.com/blogs/-/blogs/increasing-capacity-and-decreasing-response-times-using-a-tool-you-re-probably-not-familiar-with
In both cases, designing a landing page based upon a brochure site with minimal dynamic aspects and optimized content, image, etc and you too can appear to have a higher ranking.
RE: Google PageSpeed
Regular Member Posts: 136 Join Date: 4/2/14 Recent PostsRE: Google PageSpeed
New Member Posts: 24 Join Date: 7/29/08 Recent PostsClients that I work with see a business impact beyond seeing a low score through the PageSpeed Insights tool. If this was not the case, I would also support ignoring the PageSpeed Insights' report score.
Google will not allow marketing campaigns to be published for mobile automatically for low scoring sites. A direct call to Google to 'manually override' the low score is required to publish a campaign. My team's goal is to improve this process and avoid lost time for future client campaigns in addition to potential performance improvements along the way.
With minor theme customizations we are able to get a score of 36-40 consistantly and will be working toward a 50 + consistant score.
As I continue our investigation of options, I will watch this ticket and follow up with lessons learned through this process. Thank you.
RE: Google PageSpeed
Regular Member Posts: 149 Join Date: 8/29/12 Recent Postscan you tell me a little bit about what you did to achieve a 30/40+ Score at Google PageSpeed for mobile?
I did a lot of "optimizations" for a customer's theme and it does not get more than 20 Points at Google PageSpeed.
Thanks a lot.
Regards,
Dominik
RE: Google PageSpeed
Regular Member Posts: 166 Join Date: 7/23/12 Recent PostsOn which verison of Liferay did you try to optimize?
Regards,
Arun
RE: Google PageSpeed
Regular Member Posts: 149 Join Date: 8/29/12 Recent PostsRE: Google PageSpeed
New Member Posts: 24 Join Date: 7/29/08 Recent Posts- Moving any custom theme non-amd-loaded, javascript resource calls into main.js, allowing for a single resource call that is minimized (+10 pt for our use case)
- Consolidating any custom theme css resource calls into _custom.scss, allowing for a single resource call that is minimized
- Making use of GZip compression on the Apache Web Server to greatly lower resource file size. (+20 pt for our use case)
RE: Google PageSpeed
Regular Member Posts: 149 Join Date: 8/29/12 Recent Postswe did already most of the things you but still receive a score < 20 on mobile and < 60 on desktop.
If you are interested, here is a list of optimization we did:
- Using Adaptive Media for all images
- Enabling the "Header" fitler in Liferay, so that "cache-control" headers are set correctly
- Enabling the "GZIP" filter in Liferay
- Lazy loading for many images (e.g. images are not loaded at first, but only when they come into view, e.g. you scoll to the positon where the image is)
- Loading non critical Javascript asynchronously (e.g. scripts which are not needed at first but can be loaded after the page is already displayed in the browser)
- Minifying all own Javascript files
RE: Google PageSpeed
Liferay Legend Posts: 14916 Join Date: 9/2/06 Recent PostsOther changes going in too (that I don't have details on) that will also impact PageSpeed numbers...
RE: Google PageSpeed
Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent PostsOne important thing, though: HTTP/1.1 and HTTP/2
In HTTP/1.1 you want as few files as possible.
In HTTP/2.0 you don't care. More files are often actually better.
I habe this is considered in the optimizations. We are still not there yet with HTTP/2, but isn't uncommon anymore and we have customers, that already use it. An optimization that is exceptional for HTTP/1.1 might be detrimental for HTTP/2.0 ...
I also couldn't resist and tested the Alpha with Lighthouse just now, but the changes are apparently not there yet. While it is better in some metrics than 7.1, it still receives 0 points on performance.