awslabs / amazon-quicksight-embedding-sdk

A SDK to help users embed QuickSight dashboards on other pages.
Apache License 2.0
171 stars 40 forks source link

embed iframe with leading attribute set to lazy #199

Closed etylsarin closed 8 months ago

etylsarin commented 9 months ago

Hi,

Is there any option how to make the embedded iframe to use lazy loading? And if not, is there any plan to enable it?

Thank you, Filip

Allymonies commented 8 months ago

Hello,

To help us better provide assistance, could you describe your use case for this request? The Embedding SDK does not currently support setting the lazy loading attribute on the embedding iframe but depending on use case there may be alternatives available.

Thanks, Alyssa

etylsarin commented 8 months ago

Hello,

To help us better provide assistance, could you describe your use case for this request? The Embedding SDK does not currently support setting the lazy loading attribute on the embedding iframe but depending on use case there may be alternatives available.

Thanks,

Alyssa

Hi Alyssa, We would like to embed multiple QS iframes to our page, some of those would be below the fold by default. For those it would be great to lazy load for better performance of the whole page. From my perspective it wouldn't be any difficult to propagate this flag from a config to iframe props.

Thanks, Filip

Allymonies commented 8 months ago

Because embed URLs are only valid for 5 minutes, it's unreliable to have an iframe be lazy loaded. Our recommendation for this use case is to wait to fetch an embed URL and call embeddingContext.embedDashboard until the desired point is scrolled into view if lazy loading is required.

etylsarin commented 8 months ago

Ok, makes sense. Thank you!