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

Enhancement: Caching of get_ai_assistance_feature function #37936

Open
mdbitz opened this issue Jun 18, 2024 · 1 comment
Open

Enhancement: Caching of get_ai_assistance_feature function #37936

mdbitz opened this issue Jun 18, 2024 · 1 comment
Assignees
Labels
[Extension] AI Assistant [Focus] Performance [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

@mdbitz
Copy link
Contributor

mdbitz commented Jun 18, 2024

Impacted plugin

Jetpack

What

Expand the AI Assistance feature Cache Timeout

How

The cache time on get_ai_asistance_feature function is too short and contributes to a large number of public-api requests.

Please review the timeout (currently 10 seconds) and increase to a reasonable value.

In addition non 200 responses need to be cached to minimize public-api calls to WP.com
see line 423 of lib/class-jetpack-ai-helper.php. These should possibly have longer timeout lengths to ensure to minimize traffic if WP.com is unable to respond to requests.

@mdbitz mdbitz added the [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it label Jun 18, 2024
@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Jun 18, 2024
@anomiex
Copy link
Contributor

anomiex commented Jun 19, 2024

These [non-200 response caches] should possibly have longer timeout lengths to ensure to minimize traffic if WP.com is unable to respond to requests.

Error caching is a hard one to balance. While hammering a struggling server isn't good, you also don't want a transient error from the server to turn into a long outage on the client due to the error being cached.

@vianasw vianasw self-assigned this Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Extension] AI Assistant [Focus] Performance [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

4 participants