Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add loading=lazy attribute to iframes generated by pym.js #741

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

bothness
Copy link

What

Changed pym.js code to make iframes have a loading="lazy" attribute. This will significantly reduce server load when users request pages with a load of data viz content in iframes.

How to review

Load a page with a data viz iframe (eg. https://www.ons.gov.uk/economy/inflationandpriceindices/articles/howisinflationaffectingyourhouseholdcosts/2022-03-23) and make sure that the iframe loads correctly and has a loading="lazy" attribute.

Who can review

The change was made by me based on discussions involving @418error

Copy link
Contributor

@jondewijones jondewijones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned on slack on 15 Mar 2024

A concern with this approach would be that we're modifying a third party minified library which creates a maintenance problem for us and isn't best practice.

It could be worth more investigation to identify other possible solutions/approaches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants