Sitemap
Bits and Pieces

Insightful articles, step-by-step tutorials, and the latest news on full-stack composable software development

Follow publication

Best Practices on Embedding Third-Party Web Widgets

7 min readOct 27, 2021

--

Build in AI speed — Compose enterprise-grade applications, features, and components
Build in AI speed — Compose enterprise-grade applications, features, and components

What are Third-Party Embeds?

Measuring the Effect of Third-Party Embeds on Application Performance

Also, we can use the Lighthouse extension of Chrome DevTools to measure the same.

Best Practices when loading Third-Party Embeds

1. Lazy-Loading

We can use Lazy loading to load embedded resources only when they are required.

Credits: developers.google.com/web/fundementals

Also, you can utilize browser-level lazy-loading to defer load offscreen iframes.

Lazy loading iframes can be efficient if you are working with maps or videos.

2. Script Ordering

We can use async and defer properties within the script tag to order the execution of scripts.

Using Async vs Defer

3. Replace Embeds with Facades

Facades are non-functional static element similar to embeds.

A map as a facades

1. Using CMS plugins

2. Use facades recommended by Google

3. Programmer developed facades

4. Reducing Layout Shifts

Specifying dimensions

iframe size is specified using fixed values for width and height attributes

Utilize empty slots

Conclusion

Build composable web applications

https://cdn-images-1.medium.com/max/800/1*ctBUj-lpq4PZpMcEF-qB7w.gif

Learn More

--

--

Published in Bits and Pieces

Insightful articles, step-by-step tutorials, and the latest news on full-stack composable software development

Written by Ravidu Perera

Royalist | Software Engineer | Postgraduate student in Big Data Analytics|

Responses (1)