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

perf: store form meta data results under correct cache key #3982

Closed
ravinderk opened this issue Feb 4, 2019 · 0 comments

Comments

Projects
None yet
3 participants
@ravinderk
Copy link
Collaborator

commented Feb 4, 2019

Bug Report

User Story

As an admin, I want my website to load faster, but currently, I am seeing additional meta queries on each page load ( Query Monitor ).

ref: https://secure.helpscout.net/conversation/759921560/0/?folderId=672194

Current Behavior

We are using WP_Query to get forms than by default WordPress loads metadata of each form to cache within post_meta key.

https://github.com/WordPress/WordPress/blob/32ee2ed5734357d5faa5537d9916ada07f672eaf/wp-includes/meta.php#L888

We have custom meta table for form, so whenever we do meta query then we define meta_type and it is used to search meta query result in cache. We always get cache miss because cache always store under post_meta key instead of form_meta
https://github.com/WordPress/WordPress/blob/32ee2ed5734357d5faa5537d9916ada07f672eaf/wp-includes/meta.php#L520

We can reduce a lot of query by storing meta cache under correct cache key.

Acceptance Criteria

  • Meta query result does store into correct meta cache object. For example, meta cache stores into form_meta if meta type is form
  • Meta cache updates when editing donation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.