Open vmanthos opened 1 year ago
@vmanthos This should happen only when Used CSS is not present on the page, right?
This should happen only when Used CSS is not present on the page, right?
If we can detect that Google Fonts are preloaded while used CSS is applied, I think it would be nice to add the preconnect
hint for fonts.googleapis.com/
. We won't need the one for fonts.googleapis.com
.
Is your feature request related to a problem? Please describe.
Currently, we are adding a
preconnect
hint forfonts.gstatic.com
when the Optimize Google Fonts feature is enabled: https://github.com/wp-media/wp-rocket/blob/b8d34c4b9f8ebbbe9cd9317d826c84dc15ac5493/inc/Engine/Optimization/GoogleFonts/Subscriber.php#L79-L82We should do the same for
fonts.googleapis.com
. See Additional context.Describe the solution you'd like
preconnect
fonts.googleapis.com when Google Fonts are optimized.Describe alternatives you've considered
N/A
Additional context
This is an example of the snippet provided by Google Fonts to add a font on a site:
Both
fonts.gstatic.com
andfonts.googleapis.com
havepreconnect
resource hints.Acceptance Criteria
fonts.googleapis.com
domainfonts.googleapis.com
domainfonts.googleapis.com
domain