add loading=lazy attribute to iframes generated by pym.js#741
Open
add loading=lazy attribute to iframes generated by pym.js#741
Conversation
Contributor
jondewijones
left a comment
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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