Reduce the numbers or requests made to WooCommerce
The refactoring commit that added a new Subcription
class to wrap all WC related operation also increased the number of request that the middleware does to WooCommerce.
The goal of this issue is to reduce that number of requests.
Possible solutions
-
Cache WC user id in
purist.models.User
class after first call toget_woocommerce_id()
. -
Store WC user id in
purist.models.User
model after first call toget_woocommerce_id()
for users that don't have that field and store it during creation of WC account for new users.