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

197
Vistas
Slow page with multiple iframes

I have page with 20 modals and every each of them opens an iframe with youtube video in it. The problem is that the page is painfully slow because of it. Do you have any suggestions how can I fix this? Another thing is that I'm getting this error:

The service worker navigation preload request was cancelled before 'preloadResponse' settled. If you intend to use 'preloadResponse', use waitUntil() or respondWith() to wait for the promise to settle.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

On page load, browser is trying to download all the youtube videos.
So it gets slow.
If you load videos on modal click, page load time will be better.
Something like that:

function domReady(callback) {
    document.readyState === 'interactive' || document.readyState === 'complete' ? callback() : document.addEventListener('DOMContentLoaded', callback);
}

domReady(function () {
    const videoModals = document.getElementsByClassName('video-modal');

    Array.from(videoModals).forEach((el) => {
        el.addEventListener('click', function () {
            // load video
        });
    });
});
about 4 years ago · Juan Pablo Isaza Denunciar
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