4

I'm working with Gatsby.js Everything was pretty nice since I've started building the menu. When I clicked the Link component I've waited for about 2 seconds and then I was redirected to the next page. The weird thing is that the URL is changing instantly, but the content is not.

I read this article https://www.gatsbyjs.org/blog/2019-06-12-performance-improvements-for-large-sites

But it doesn't help anyway.

Edit: If the content on the next site is small the delay is also smaller.

Github issue: https://github.com/gatsbyjs/gatsby/issues/21193

  • did you check if the same lag appears, if you navigate back and click the link again? – Stefan F. Feb 04 '20 at 10:27
  • Yes, it happens every time, but sometimes it's less buggy – Maksymilian Konarski Feb 04 '20 at 10:33
  • I'm not very good with gatsby but i assume it could be a problem with your pages-manifest.json https://www.gatsbyjs.org/blog/2019-06-12-performance-improvements-for-large-sites/#the-problem-global-pages-manifest – Stefan F. Feb 04 '20 at 10:37
  • It can be, but as the Gatsby team wrote in this article: "From this point forward, your application manifest will no longer grow proportionally to the number of pages in your Gatsby application." So I assume that the Gatsby 2.9 contains this fix – Maksymilian Konarski Feb 04 '20 at 10:40
  • As i understand the article you maybe need to activate this, i'm not sure if this working automatically. You could check your manifest file in the chrome dev tools to see how much data is in there – Stefan F. Feb 04 '20 at 10:47
  • Hmm, I am not sure about that, I think if there would be the option to turn it on, they probably will write the article/tutorial how to do it. Manifest in Chrome looks normal - it contains the URL, icons, info about service workers, nothing special. – Maksymilian Konarski Feb 04 '20 at 11:02
  • Did you ask on the Gatsby community? – barny Feb 05 '20 at 17:12
  • I've already created the issue ticket on Github https://github.com/gatsbyjs/gatsby/issues/21193 – Maksymilian Konarski Feb 06 '20 at 10:09
  • @MaksymilianKonarski have you solved the issue. I am currently facing it. Please do help if you have resolved it – Harikrishnan Jul 07 '20 at 05:07
  • 2
    @MaksymilianKonarski Facing the same issue, let us know if you got any fix :) – Rahul Suresh Jul 07 '20 at 08:17
  • @RahulSuresh Are you using `preact` and `gatsby-plugin-preact` ? – Harikrishnan Jul 10 '20 at 13:19
  • @Harikrishnan Nope, its the default gatsby template which uses react. But I just noticed that it happens only when page hasn't loaded/painted completely. If the net speed is fast and if the paint completes, then there is no delay. – Rahul Suresh Jul 10 '20 at 16:01
  • @RahulSuresh Gatsby will only prefetch links if the network is 3G and above. My problem was with the `preact` and `gatsby-plugin-preact` – Harikrishnan Jul 11 '20 at 05:23
  • @Harikrishnan I didn't solve the problem – Maksymilian Konarski Jul 11 '20 at 10:42

0 Answers0