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

Google Fonts: use dynamic browser user agent #28120

Closed
simison opened this issue Dec 30, 2022 · 1 comment
Closed

Google Fonts: use dynamic browser user agent #28120

simison opened this issue Dec 30, 2022 · 1 comment
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

Comments

@simison
Copy link
Member

simison commented Dec 30, 2022

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:

$args = array( 'user-agent' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0' );

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).

@simison simison added the [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it label Dec 30, 2022
@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Dec 30, 2022
@simison
Copy link
Member Author

simison commented Nov 13, 2024

These APIs are deprecated longer ago already.

@simison simison closed this as completed Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant