- This topic has 12 replies, 3 voices, and was last updated 4 years, 3 months ago by
David.
-
AuthorPosts
-
April 23, 2021 at 1:38 am #1745629
Annalena
Hi! When running my site on googles page speed insight I got a terribly low score, 44 on mobile and 85 on computer, I got the suggestion to put the following code into my html, but where on my site do I find the html? I tried to paste it in simple css but that didn’t work.
<head>
…
<link rel=”preload” href=”styles.css” as=”style”>
<link rel=”preload” href=”ui.js” as=”script”>
…
</head>Kind regard
Annalena JanssonApril 23, 2021 at 9:15 am #1746252David
StaffCustomer SupportHi there,
if you want to add those links to the
<head>
then you would use a Hook Element:https://docs.generatepress.com/article/hooks-element-overview/
Add just the
<link>
code to the Hook text area.
Set the Hook to:wp_head
Then set the Display Rules Location to:Entire Site
In your code the href=”” will probably need to contain the full URL for the styles and JS files you want to preload.
April 26, 2021 at 9:05 am #1749809Annalena
Hi David!
Thanks for your reply. I think I might be able to do it with help of the instruction video, but I don’t know what this means: In your code the href=”” will probably need to contain the full URL for the styles and JS files you want to preload.
Can you please explain that?
There are a lot of images on my site, do I need the full URL of each and every one of them to be placed somewhere?
Thanks!
April 26, 2021 at 6:06 pm #1750161Elvin
StaffCustomer SupportHi there,
Preloading is specific. This is done specifically on an asset of a specific plugin or theme asset so it loads early as some are required to load earlier than others.
There are a lot of images on my site, do I need the full URL of each and every one of them to be placed somewhere?
It’s not exactly good practice to preload ALL images on your site. This is generally done for above the fold images to address CLS and LCP.
Can you specify what image/s do you want to preload?
April 27, 2021 at 9:48 am #1751214Annalena
Hi Elvin! The thing is I have no idea what we are talking about, my site loads to slow and when I check what I can do about it, one suggestion was to use: <link rel=preload>, and I don’t know what that is or what to do with it. I have made my site myself by watching youtube, so I don’t know anything about coding. Once upon a time my site loaded in milliseconds and now it takes about five seconds.
Thanks!
April 27, 2021 at 6:31 pm #1751770Elvin
StaffCustomer SupportThere’s quite a lot to improve on actually.
As for preloading things. Performance testing site reports suggest preloading these 2:
https://share.getcloudapp.com/yAuDJGyzBut you can actually skip preloading generatepress.woff2 by going to Appearance > Customize > General and set the icon type to “SVG”.
As for the
WPMenuCart.woff2
, the theme doesn’t control that.But this can simply be done by the caching/optimization plugin you’re using or by doing it manually by hooking something like this on your
wp_head
by using a Hook element. https://docs.generatepress.com/article/hooks-element-overview/<link rel="preload" href="wp-content/plugins/woocommerce-menu-bar-cart/font/WPMenuCart.woff2" as="font" type="font/woff2" crossorigin="anonymous">
Note: you may have to change the
href=
value to the URL of your site.But I believe this is crucial to address as well.
https://share.getcloudapp.com/geubEjRpThis flag is issued when the performance testing site deems your site’s hosting too slow. This is generally addressed by changing to a better performing host/server.
April 28, 2021 at 2:59 am #1752533Annalena
Hi Elvin! What did you mean by this: But I believe this is crucial to address as well.
https://share.getcloudapp.com/geubEjRpI have put the code you gave me in the element area and I told it to be wp_head, and the priority as it was. Is that correct? Will this increase the loading time to my site? I also changed to SVG.
Thanks!
April 28, 2021 at 3:44 am #1752609Annalena
Hello again! Testing my site now after doing the recommended adjustments and it’s even slower! HELP!
April 28, 2021 at 5:01 am #1752767David
StaffCustomer SupportHi there,
this:
https://share.getcloudapp.com/geubEjRpThat is saying your Hosting Server is taking over 3 seconds to respond when a user tries visiting your site.
You should speak to your hosting company about this problem. Its a major issue and should be fixed before any other improvements are made to your sites performance.April 28, 2021 at 5:48 am #1752859Annalena
Thanks David!
Did I do it the right way with the code you gave me? I have put the code you gave me in the element area and I told it to be wp_head, and the priority as it was. Is that correct? Will this increase the loading time to my site? I also changed to SVG.
Kind regards!
April 28, 2021 at 6:16 am #1752935David
StaffCustomer SupportYep – you did it the correct way 🙂
Things to note:
Fonts are loaded asynchronously – so the Browser will happily display the page before the font is loaded.
The Preload simply tells the browser it must Load it first – so the side effect is that the browser has to download the font before it can display the page – so you notice a little more time taken to initially load the page.Thats why the other Initial Server Response time is the main factor for improvement.
A lot of issues raised on page speed all come down to how fast the server and network connection is. If its fast then you won’t see a lot of issues reported – if its slow then all sorts of problems get raised.April 28, 2021 at 10:26 am #1753801Annalena
Thanks David! I have contacted my web host and they told me to increase the memory in FTP, I haven’t done that yet, but if that doesn’t help then I guess I have to switch web host.
Thank you for now!
April 29, 2021 at 12:31 am #1754763David
StaffCustomer SupportGlad we could be of help.
-
AuthorPosts
- You must be logged in to reply to this topic.