Open midweste opened 1 year ago
Hi @midweste,
Thank you for opening the issue! It requires further feedback from the WooCommerce Core team.
We are adding the needs developer feedback
label to this issue so that the Core team could take a look.
Please note it may take a few days for them to get to this issue. Thank you for your patience.
Hi @midweste,
Thanks for reaching out and for all the details you've shared in the issue. We're definitely interested in improving performance, and so we're marking this as a high priority enhancement. Thanks again!
May be a good candidate to pair with #37629.
Prerequisites
Describe the bug
Bug:
Expected behavior
read_price_data does not recompute prices every time and reads from transient
Actual behavior
read_price_data recomputes price data each time because $price_hash changes every run
First run: $price_hash array on line 425 of woocommerce/includes/data-stores/class-wc-product-variable-data-store-cpt.php - evaluates to "56a3c2b4e9a476f6abd6426393fe6f74"
Second run - Same exact hooks - should be the same price_hash, read_price_data should not recompute all prices: $price_hash array on line 425 of woocommerce/includes/data-stores/class-wc-product-variable-data-store-cpt.php - evaluates to "3fa707c32a07b825b5380d9b38095cd6"
Line 274 of never uses cache
IMO
Steps to reproduce
Add class and make sure it runs:
Set a breakpoint on line 274 of woocommerce/includes/data-stores/class-wc-product-variable-data-store-cpt.php Observe transient cache never being used on line 274
WordPress Environment
Not needed
Isolating the problem