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

Warmup post languages in WP_Query #138

Open
goncaloasimoes opened this issue Feb 19, 2025 · 0 comments
Open

Warmup post languages in WP_Query #138

goncaloasimoes opened this issue Feb 19, 2025 · 0 comments
Assignees

Comments

@goncaloasimoes
Copy link
Contributor

When a WP_Query fetches X amount of posts. If there is a processing in the frontend of the queried posts to fetch their permalinks, each of them will have their language fetched. LangInterface::get_post_language has a transient, but if there is no transient for the posts, there will be a lot of different separate queries to get each post's language.

In order to combat this, upon a successful WP_Query for posts, we can warmup these transients with the post languages by doing one query for all of them.

@goncaloasimoes goncaloasimoes self-assigned this Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant