pagespeed

Why there exist error Uncaught ReferenceError: $ is not defined if add async?

十年热恋 提交于 2021-01-28 18:31:43
问题 My index like this : ... <html > <head> ... <script src="/scripts/myapp.min.js"></script> <script src="/scripts/myapp-themming.min.js"></script> </head> <body class="header-static"> <div class="page-container"> <!-- this is call header, navigaton, content, footer --> </div> <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <script type="text/javascript" src="/Content/assets/script/jquery-ui.min.js"></script> ... <script type="text/javascript"> ... <

Load third party iframe in React after page load, so that the iframe does not affect PageSpeed score

眉间皱痕 提交于 2021-01-27 14:50:01
问题 I have an iframe that loads a third party widget. I only want to display this iframe after my page has loaded, because I don't want to slow down my page load speed. I followed a medium article which describes how to do this, but their solution doesn't work because the onload function, finishLoading , is never called export default ({src, width, height}) => { const [loading, stillLoading] = useState(true) const finishLoading = () => { alert('finished loading') stillLoading(false) } ... return(

Largest contententful paint (LCP) on lighthouse is a p tag. (Using gatsby)

穿精又带淫゛_ 提交于 2021-01-27 12:50:51
问题 I don't know why my LCP would be a p tag, and I have no idea what I would do to reduce the size of it. Sometimes it gets up to 2.6s and gives a yellow rating(instead of green). This is the p tag. All of those classes are bootstrap classes. <p className="text-center mb-md-5 mt-0 mb-5">{aboutText}</p> This is the variable aboutText const aboutText = `Suddenly Magazine highlights the uniqueness of Saskatchewan, and its sudden rise in popularity and growth mentioned in publications such as USA

Defer loading of js how?

你离开我真会死。 提交于 2021-01-27 05:57:23
问题 I have the following js script referenced on the bottom of the page: <script src="http://example.com/test.js" type="text/javascript"></script> Google PageSpeed suggestion is to defer the loading of this js. I don't quite understand how to do that or the repercussions. Can someone please explain? 回答1: Adding the attribute defer to the <script> tag should do it. E.g.: <script src="http://example.com/test.js" type="text/javascript" defer></script> The idea is that the script in the file is

Largest contentful paint is one big gatsby-background-image and very slow

試著忘記壹切 提交于 2021-01-25 07:10:22
问题 For those stumbling on this question wondering how to improve their lighthouse score in general, I posted an answer on this topic on another question with lots of general tips. I'm running PageSpeed insights and my biggest problem is the largest contentful paint, at about 8-10 seconds. Below they list my largest contentful paint element Largest Contentful Paint element 1 element found This is the largest contentful element painted within the viewport. Learn More Element This is the a

Laravel | Speed difference between vhost and php Server

丶灬走出姿态 提交于 2020-12-13 03:21:29
问题 I made a vhost for my local Laravel installation. The thing is, that the variation with 127.0.0.1:8000 is so much faster than the "example.local"-vhost which points to the public/ directory of Laravel. Of course the vhost uses Apache. Why is there such a speed difference? While the IP version has a lighthouse speed score of 100 the vhost has only 72 which is a significant difference. Can anyone help me with this? How do I get the same performance? 来源: https://stackoverflow.com/questions

When to use rel=“preload”? Why is preloading fonts/FontAwesome a good idea?

丶灬走出姿态 提交于 2020-12-12 02:43:07
问题 I got this recommendation, in Google Pagespeed: The 'learn more'-link leads to 404. I tried figuring out, why this is supposed to save me 7.08 seconds, but can't find it. I would assume that loading 10 icons on a page would be the very last priority?! Isn't images, other fonts and scripts more important? Or is somehow stalling something, that these fonts aren't loaded? I can see in my Network-tab, that if I load the fonts as such: <link rel="preload" href="css/fontawesome.css" as="style"

PageSpeed giving ERR_CONNECTION_FAILED Only on production

跟風遠走 提交于 2020-08-10 19:01:43
问题 We have our development page giving correct score on page speed insights. https://developers.google.com/speed/pagespeed/insights/?hl=en&url=https%3A%2F%2Fdev.techtitute.com But our production page always returns scan error: Lighthouse returned error: FAILED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Details: net::ERR_CONNECTION_FAILED) https://developers

PageSpeed giving ERR_CONNECTION_FAILED Only on production

与世无争的帅哥 提交于 2020-08-10 18:58:47
问题 We have our development page giving correct score on page speed insights. https://developers.google.com/speed/pagespeed/insights/?hl=en&url=https%3A%2F%2Fdev.techtitute.com But our production page always returns scan error: Lighthouse returned error: FAILED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Details: net::ERR_CONNECTION_FAILED) https://developers