Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

224
Vistas
How do I avoid all deferred scripts being evaluated and compiled in one single task causing a long task on the main thread?

It seems that using defer on scripts causes all of these scripts to be evaluated compiled and executed at once meaning in one single task before the DOMContentLoaded event.

This means if you or I have in my case a few of these scripts that are fairly slow to be executed, the task can become long and degrade the performance and Core Web Vitals of the page.

Most of these script depend on each other or at least should be executed in order, that's why the goto strategy was to use defer but I didn't know about the result of them being executed in a single task.

My plan is to insert some of them with JS when the DOMContentLoaded is fired, but this means that unless I preload them, they'll start to be downloaded much later. The end result is different than simply using defer.

Is there any way of breaking up that one long task or avoiding all of the deferred scripts being 'done' in one task?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda