Google Fonts: use dynamic browser user agent #28120
Labels
[Plugin] Jetpack
Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/
[Type] Enhancement
Changes to an existing feature — removing, adding, or changing parts of it
Impacted plugin
Jetpack
What
Switch static browser agent to dynamic one.
How
When requesting Google Fonts API at the backend, we pass a static browser user agent with the request:
jetpack/projects/packages/google-fonts-provider/src/class-google-fonts-provider.php
Line 91 in 063d4eb
Google Fonts API can return different response depending on the user agent (see docs).
As time goes by, our static agent likely won't get updated. Google API at some point start think they're responding to old browser and need to avoid sending some unsupported features.
Since the response is cached, it might make sense to include the browser name/version in the cache key. The whole user agent string in the key is likely too much.
The browser user agent is used at also at our own API implementation (pMz3w-g6E-p2/#comment-103419).
The text was updated successfully, but these errors were encountered: