La carga diferida nativa a nivel del browserUn navegador (además: browser) es una herramienta informática que te permite ver documentos y datos y navegar por la red. Los navegadores pueden mostrar distintos tipos de recursos de información; principalmente documentos HTML, a pesar de todo, además son posibles otros tipos de archivos y contenido multimedia, como PDF, JPEG, MPEG, GIF o el lenguaje de meta marcado. A través el uso de complementos especiales y la configuración respectivo, los plus para iframes está aquí
The native lazy loading for landed images in Chrome 76 via loading attributeAtributo es una definición que se usa en varios campos de IT. Generalmente, un atributo se usa para describir un fichero o un campo de datos con más detalle. En la programación orientada a objetos, los atributos son una propiedad o característica que se puede asignar a un objeto (elemento). A través el uso de atributos se pueden asignar valores específicos a ciertos items. Áreas de aplicación Las tres áreas plus y luego llegó a Firefox. Estamos felices de compartir eso
native lazy loading for iframes is now
standardized y también es compatible con los browsersConcepto de Navegadores¿Qué son los Navegadores?Los Navegadores son herramientas informáticas que utilizamos para, normalmente, navegar por Internet y visitar cualquier página web, al mismo tiempo de para hacer otras tareas como ver documentos, observar vídeos o reproducir contenido multimedia de cualquier tipo. Son un tipo de software sencillamente usual y bastante utilizado hoy en día.Insistimos en que es algo que se utiliza con mucha frecuencia, puesto que moverse por Internet plus Chrome y Chromium.
<iframeConcepto de Iframe¿Qué es un Iframe?Un Iframe es un documento de una web que se inserta en otra página web. Consiste en un elemento que puede albergar cualquier tipo de contenido en su interior y que ayuda, entre otras cosas, a ampliar el mensaje que se ofrece con fuentes externas o con material complementario que pueda resultar de interés para el usuario que entra.Este elemento web se usa especialmente al plus src="httpsHTTPS (protocolo de Transferencia de Hiper-Texto) es un protocolo que permite determinar una conexión segura entre el servidor y el cliente, que no puede ser interceptada por personas no autorizadas. En resumidas cuentas, es la versión segura de el http (Hyper Text Transfer Protocol) Cómo funciona Una conexión HTTP estándar en Internet puede ser fácilmente secuestrada por partes no autorizadas. El propósito de una conexión HTTPS es evitar esto: encriptar plus://example.com"
loading="lazy"
width="600"
height="400"></iframe>
Native iframe lazy loading defer loading iframes off-screen until the user scrolls close to them. This saves data, speeds up the loading of other parts of the page, and reduces memory usage.
Is manifestation from
shows lazy loading video embeds:
Why should we lazily load iframes?
Las incrustaciones de terceros cubren una amplia gama de casos de uso, desde reproductores de video hasta publicaciones en redes sociales y anuncios. A menudo, este contentsEl contenido puede ser muy difícil de definir con precisión. Es una definición que se refiere a las declaraciones contenidas en un documento o publicación de cualquier tipo y puede incluir las tecnologías de la información y la comunicación. Esto cubre todos los tipos de medios como imágenes y texto. A parte de esto, en el campo de la optimización de motores de búsqueda, los términos duplicar contenido, contenido único, plus no es inmediatamente visible en la ventana gráfica del usuario. Más bien, solo se ve una vez que se desplazan hacia abajo en la página. A pesar de esto, los usuarios pagan el costo de descargar datos y JavaScriptJavaScript es un lenguaje de programación que funciona en el lado del cliente y con el que las webs pueden ser más funcionales. Incorporación en código HTML El código JavaScript puede ser incrustado en las páginas HTML, para que adquieran funcionalidad. Existen varias opciones. Puede estar entre las etiquetas <SCRIPT> y </SCRIPT>, puede estar contenido en un archivo externo, puede ser un parámetro de las etiquetas HTML, y puede estar plus costoso por cada marco, incluso si no se desplazan hasta él.

Based on Chrome's research on iframes off screen lazy loading automatically for Data Saver users, lazy loading iframes could result in average data savings of 2-3%, first paint reductions with 1-2% content in the median, and 2% improvements in first entry delay (FID) at the 95th percentile .
How does native lazy loading work for iframes?
the loading The attribute allows a browser to defer the loading of iframes and images off the screen until users scroll close to them. loading supports three values:
lazy: is a good candidate for lazy loading.eager: not a good candidate for lazy loading. Charge immediately.car: the browser will determine if it loads lazy.
car It is currently a non-standard value, but it is the default in Chrome today. Chrome intends to bring a proposition of this value to the standards table.
Using the loading attribute in iframes works as follows:
<iframe src="https://example.com"
loading="lazy"
width="600"
height="400"></iframe>
<iframe src="https://example.com"
width="600"
height="400"></iframe>
<iframe src="https://example.com"
loading="eager"
width="600"
height="400"></iframe>
Not specifying the attribute at all will have the same impact as explicitly loading the resource with enthusiasm, except for The light mode
users, where Chrome will use the car value to decide if it should be lazy loaded.
If you need it dynamically create iframes via JavaScript, setting
iframe.loading = 'lazy' in the element is also
supported:
var iframe = document.createElement('iframe');
iframe.src = 'https://example.com';
iframe.loading = 'lazy';
document.body.appendChild(iframe);
Iframe specific lazy loading behavior
The load attribute affects iframes differently than images, depending on whether the iframe is hidden. (Hidden iframes are often used for analytical or communication purposes.) Chrome uses the following criteria to determine if an iframe is hidden:
- The width and height of the iframe are
4pxor less. display: noneorvisibility: hiddenIt is applied.- The iframe is positioned off screen using negative X or Y positioning.
- This criterion applies to both
loading = lazyandloading = auto.
If an iframe meets any of these conditions, Chrome considers it hidden and will not lazy load it in most cases. Iframes that are not hidden will only load when they are within the loading distance threshold. Chrome shows a placeholder for lazy-loaded iframes that are still retrieving.
What impact could we see in popular lazy-loading iframe embeds?
What if we could change the web in general so that the lazy loading screen iframes were the default? It would look a bit like this:
Incrustaciones de videos de YoutubeConcepto de Youtube¿Qué es Youtube?Youtube es una de las plataformas más utilizadas e importantes de todo internet. Consiste en un rincón del océano digital dedicado única y exclusivamente al contenido en vídeo, permitiendo a los usuarios tanto publicar contenidos audiovisuales como consumirlos. Es el principal lugar al que acudir al momento de buscar algún documento en forma de vídeo o de ver cualquier tipo de publicación elaborada en este formato.Una plus de carga diferida (ahorra ~ 500 KB en la carga de la página inicial):
<iframe src="https://www.youtube.com/embed/YJGCZCaIZkQ"
loading="lazy"
width="560"
height="315"
frameborder="0"
allow="accelerometer; autoplay;
encrypted-media; gyroscope;
picture-in-picture"
allowfullscreen></iframe>
Anecdote: When we switched to lazy loading YouTube embeds for Chrome.com, we saved 10 seconds from how quickly our pages could be interactive on mobile devices. I opened an internal error with YouTube to discuss how to add
loading = lazy to your embed code.

If you are looking for more efficient ways to upload YouTube embeds, you may be interested in the YouTube lite component.
Inserciones de InstagramConcepto de Instagram¿Qué es Instagram?Instagram es una de las redes sociales más reconocidas del momento. Comprada por Facebook hace unos años con motivo de su auge en popularidad, se caracteriza por girar en torno a la fotografía y, desde hace poco, al vídeo. Es una red pensada para los amantes de las fotos y para quienes gustan ilustrar lo que hacen con material gráfico.Desde su lanzamiento, ha estado en constante plus de carga diferida (ahorra> 100 KB en gzip en la carga inicial):
Instagram embeds provide a markup block and script, which injects an iframe into your page. Lazy loading this iframe avoids having to load all the script required for the insert. Since such embeds are often shown below the viewport in most articles, this seems like a reasonable candidate for native lazy loading of your iframe.
Incrustaciones de SpotifySpotify es un servicio en streaming de música que surgió de la startup sueca Spotify AB. Spotify te permite escuchar música en tu PC, tablet y teléfono celular sin necesidad de descargarla. Como es usual en los servicios de streaming, se carga un archivo de música en la caché para que pueda reproducirse de forma directa con la app. Spotify está habilitada en la versión actual como servicio sin costes plus de carga diferida (ahorra 514 KB en la carga inicial):
<iframe src="https://open.spotify.com/embed/album/1DFixLWuPkv3KT3TnV35m3"
loading="lazy"
width="300"
height="380"
frameborder="0"
allowtransparency="true"
allow="encrypted-media"></iframe>
Although the embeds above illustrate the potential benefits of lazy-loading iframes for media content, there is a chance to see these benefits in ads as well.
Estudio de caso: carga diferida nativa de los complementos sociales de FacebookConcepto de Facebook¿Qué es Facebook?Facebook es una red social hecha por personas y pensada para conectar a personas. Es una de las pioneras de este sector, una de las primeras plataformas que llegaron a Internet con la finalidad de facilitar la comunicación entre usuarios de todas partes, compartir información y contactar con familiares lejanos, amistades o conocidos.Hoy en día, es la red más popular de todo Internet. Nacida en 2004 plus
From Facebook social plugins Allow developers to embed Facebook content on their web pages. Several of these plugins are offered, such as embedded posts, photos, videos, comments ... The most popular is the As a complement - a button that shows a count of who has 'liked' the page. By default, embedding the Like plugin on a web page (using the FB JSSDK) pulls ~ 215KB of resources, 197KB of which is JavaScript. In many cases, the plugin may appear at the end of an article or near the bottom of a page, so enthusiastically loading it when off-screen may not be optimal.

Thanks to engineer Stoyan Stefanov, all facebook social plugins now support native iframe lazy loading. Developers opting for lazy loading via plugins data-lazy
The settings will now be able to prevent loading until the user scrolls nearby. This allows embedding to continue to work fully for users who need it, while offering data savings for those who don't scroll down a page. Hopefully this is the first of many additions to exploring native iframe lazy loading in production.
Wait, can't browsers just auto load off-screen iframes lazily?
They certainly can. In Chrome 77, Chrome added support for off-screen images and lazy loading iframes natively when a user has opted for
The light mode
(Data Saving Mode) in Chrome for Android.
Basic mode is commonly used in regions of the world where the quality of the network connection and data plans are not the best. Every byte is important, and therefore lazy-loading iframes have the potential to make a significant difference for these users.
Origins can detect what percentage of your traffic is coming from basic mode users by checking the navigator.connection.saveData property, which is part of the NetworkInformation API.
Can I lazy load iframes across multiple browsers? Yes
La carga diferida de iframe nativa se puede aplicar como una progressive improvementLa mejora progresiva es una estrategia de diseño web diseñada para permitir que el contenido básico de una web se muestre independientemente de la tecnología del navegador, la conexión a Internet o el tipo de dispositivo final. A la vez, no obstante, la web en cuestión además debería ofrecer una versión completa diseñada para satisfacer los mejores requerimientos técnicos posibles. Un resultado de esta estrategia es un diseño responsive. Una plus. Navegadores que admiten loading = lazy in iframes it will lazy load the iframe, while the loading The attribute will be safely ignored in browsers that don't support it yet.
It is also possible to lazy load off-screen iframes using the JavaScript library lazysizes. This may be desirable if:
- require more custom lazy loading thresholds than native lazy loading currently offers
- We want to provide users with a consistent iframe lazy loading experience across browsers.
<script src="lazysizes.min.js" async></script>
<iframe frameborder="0"
class="lazyload"
allowfullscreen=""
width="600"
height="400"
data-src="//www.youtube.com/embed/ZfV-aYdU4uE">
</iframe>
Use the following pattern to detect lazy loading function and get lazy sizes when it is not available:
<iframe frameborder="0"
class="lazyload"
loading="lazy"
allowfullscreen=""
width="600"
height="400"
data-src="//www.youtube.com/embed/ZfV-aYdU4uE">
</iframe>
<script>
if ('loading' in HTMLIFrameElement.prototype) {
const iframes = document.querySelectorAll('iframe[loading="lazy"]');
iframes.forEach(iframe => {
iframe.src = iframe.dataset.src;
});
} else {
const script = document.createElement('script');
script.src =
'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.min.js';
document.body.appendChild(script);
}
</script>
Una opción para los usuarios de WordPressWordPress es el software de blogs líder en el mundo, y es concretamente fácil de utilizar y adaptable. Con WordPress, es factible crear con éxito sitios web con la ayuda de funciones ya predefinidas, sin mucho esfuerzo, y para proporcionar contenido como texto, imagen y vídeo. No se requiere conocimiento de HTML. WordPress además facilita la gestión y el mantenimiento de contenidos extensos. Al mismo tiempo de su fácil manejo, plus
You might have a lot of iframes scattered over years of posting content on a WordPress site. Optionally, you can add the following code to your WordPress theme functions.php file to auto insert loading = "lazy" to your existing iframes without having to manually update them individually.
Note that Work is also underway on native support for lazy loading iframes in the WordPress core. The following snippet will search for the relevant flags so that once WordPress has the functionality built in, it will no longer manually add the loading = "lazy" attribute, making sure it is interoperable with those changes and will not result in a duplicate attribute.
function wp_lazy_load_iframes_polyfill( $content ) {
if ( function_exists( 'wp_lazy_loading_enabled' ) &Concepto de AMP¿Qué es el AMP o Accelerated Mobile Pages?El AMP, abreviatura de Accelerated Mobile Pages, es una propuesta que empezó a tomar forma en el año 2016 con la finalidad de mejorar la usabilidad, lectura y, en general, la experiencia de los usuarios de teléfono celular dentro de cualquier página web. Emprendida por Google con un aperturismo total (es de código abierto), lleva en activo desde entonces para facilitar plus;& wp_lazy_loading_enabled( 'iframe', 'the_content' ) ) {
return $content;
}return str_replace( '<iframe ', '<iframe loading="lazy" ', $content );
}
add_filter( 'the_content', 'wp_lazy_load_iframes_polyfill' );
Si su sitio de WordPress utiliza almacenamiento en cacheUn caché es un tipo de memoria auxiliar de la que se puede recuperar a alta velocidad con una capacidad de almacenamiento relativamente pequeña. Se encuentra entre la unidad central de procesamiento (CPU) y la memoria principal. Ayuda a evitar el acceso al disco duro o los recálculos complejos almacenando temporalmente ciertos datos y haciéndolos disponibles rápidamente cuando sea necesario. El caché almacena una copia de la petición actual y plus (pista: debería), no olvide reconstruir el caché de su sitio después.
conclusion
Baking in native support for lazy loading iframes makes it much easier for you to improve the performance of your web pages. If you have any comments on native iframe lazy loading feel free to submit a problem to Chrome Bug Tracker.
And in case you missed it, check out web.dev's collection of lazy loading images and videos for more lazy loading ideas.
Our thanks to Dom Farolino, Scott Little, Houssein Djirdeh, Simon Pieters, Kayce Basques, Joe Medley, and Stoyan Stefanov for their reviews.




