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

3.18 - Handling preconnect with exclusions #7098

Open
piotrbak opened this issue Nov 11, 2024 · 2 comments
Open

3.18 - Handling preconnect with exclusions #7098

piotrbak opened this issue Nov 11, 2024 · 2 comments
Labels
type: enhancement Improvements that slightly enhance existing functionality and are fast to implement

Comments

@piotrbak
Copy link
Contributor

User Story
As a user, I’d like preconnect and prefetch links not to be removed when Google Font file is excluded from being downloaded

Acceptance Criteria

  • When the Google Fonts (it's important that it's about Google Fonts, as in the future we might have other fonts hosted locally) are excluded from being downloaded, Google preconnect and prefetch links should not be removed
  • When other fonts are excluded (theoretically), Google preconnect and prefetch links should not removed
  • Removing Google preconnect and prefetch links should work without regression when there's no exclusion at all
@piotrbak piotrbak added the type: enhancement Improvements that slightly enhance existing functionality and are fast to implement label Nov 11, 2024
@jeawhanlee
Copy link
Contributor

Scope a solution ✅

We will do a check with the proposed filter here on this line which is from this PR
This will only remove the preconnect if there are no google fonts in the exclusion.

Estimate the effort ✅

[XS]

My only concern is that the filter is regex compatible and will accept either full url or a part for the exclusion which might not be sufficient enough to detect if a font is from google or not.

@wp-media/product What if we have 2 exclusion filters for both google and other fonts?

@piotrbak
Copy link
Contributor Author

@jeawhanlee In this PR we'll be checking if the regex pattern matches the HTML. Can't we also check if it matches Google URL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Projects
None yet
Development

No branches or pull requests

2 participants