-
Notifications
You must be signed in to change notification settings - Fork 109
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
Incorporate breakpoints into preconnect links added by Embed Optimizer #1341
Comments
Hi, I've reviewed this issue and have an idea for how to proceed. If it's alright and this issue isn't currently being worked on, could it be assigned to me? |
@westonruter I have some questions regarding the merging logic for preconnect links. Code in question: performance/plugins/optimization-detective/class-od-link-collection.php Lines 106 to 207 in df29967
I noticed that consecutive links with identical attributes are meant to be merged. However, when breakpoints are introduced, the merging doesn’t seem to occur correctly. Specifically, preconnect links are duplicated across viewport widths: Upon examining the sorted links (full log: https://pastebin.com/7eKfdzgt), I found that this duplication arises because the links are only sorted by I tried modifying the sorting logic to sort primarily by This approach also works for scenarios where embeds should be hidden on specific viewport ranges (e.g., hidden on phablet): Could you confirm if my approach aligns with the intended merging logic? Specifically, is it correct to group links by |
@ShyamGadde I think this sounds correct! |
The issue didn't come up before because generally only the preload links were being added with media queries. When there are multiple link types and multiple URLs being linked to, it makes sense that the current logic or sorting by the minimum viewport width would be insufficient. |
Originally posted by @westonruter in #1302 (comment)
Code in question:
performance/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php
Lines 89 to 96 in 84bf4ee
The text was updated successfully, but these errors were encountered: