Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
What event is late enough to not impact PageSpeed?

(Note, this isn't about making a random tool giving me a better number; I'm diagnosing a landing page that is having terrible performance, and based on the web vitals assessment, real users are taking nearly 10 seconds to get to interactive!)

I don't think I'm using very much JavaScript, but apparently what I am using is quite slow (Google Tag Manager and Stripe each add between 500-700 ms!!).

I've managed to get https://pagespeed.web.dev/ into the upper 80s / lower 90s for mobile, but I've done so by delaying all JavaScript. Now I only load 1 script, and that script loads the other scripts after either 5000ms or first user interaction (I check for mouseover, keydown, touchmove, or touchstart).

So far so good. However, there are some scripts I'd like to load earlier (really, as soon as possible). I've tried

window.onload = loadEarlyScripts();

document.body.addEventListener('load', loadEarlyScripts);

and

document.body.addEventListener('readystatechange', () => {
  if ( document.readystate === 'complete' ) loadEarlyScripts;
});

But all of those drop my PageSpeed performance from 85-95 to ~ 45. So, the user-interaction events are good enough, but none of these are. What's the earliest event I can target that will make PageSpeed happy?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda