Support » Plugin: WooCommerce » Issue: How can I control _transient_wc_ in WP_Options

  • Resolved Thomas Jarvis

    (@thomasjarvisdesign)


    Hi Our store has 116,000 product variations.

    Due to the volume of products I have had to modify some plugins to bring down the number of transients saved.

    Pre modification up to 500,000 transients were created in WP_Options by some plugins with poor scalability.

    Transients is filling up fast with the following values which appear to be from WooCommerce core functions

    _transient_wc_var_prices

    _transient_wc_product_children

    _transient_wc_related

    _transient_timeout_wc_XXXXX All of the above

    I have the following questions.

    1.What is being stored?

    2.Is it really necessary?

    3.Can I disable these transients? If so can you help/provide a snippet or location of the code that sets the transients?

    Notes

    We have WP-Rocket for page caching and a cache warmer so 100% of the site is crawled and cached every day.

    We are about to impliment REDIS caching. This may help by storing transients in the RAM but I need to know if I can prevent them from filling WP_Options first. Otherwise they will just fill our object cache and we will need more Ram.

    • This topic was modified 3 months, 2 weeks ago by Thomas Jarvis. Reason: extra info

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Shameem (woo-hc)

    (@shameemreza)

    Hi @thomasjarvisdesign

    I understand that you’re dealing with a large number of transients due to the volume of products in your store. I’ll do my best to answer your questions.

    1. What is being stored?

    The transients you mentioned are storing temporary data related to your WooCommerce products. Here’s a brief explanation of each one:

    • _transient_wc_var_prices: Stores the prices of variable products.
    • _transient_wc_product_children: Stores the IDs of a product’s child products.
    • _transient_wc_related: Stores related products for a product.
    • _transient_timeout_wc_XXXXX: Stores the expiry time of the transient.

    2. Is it really necessary?

    Yes, these transients are necessary as they help to improve the performance of your store by caching data that would otherwise require time-consuming queries to retrieve.

    3. Can I disable these transients?

    While it’s technically possible to disable these transients, it’s not recommended as it may negatively impact the performance of your site. However, you can manage them better. You might want to look into a plugin like Transient Cleaner or even WP Rocket, which can help you manage the lifespan of your transients.

    We are about to impliment REDIS caching. This may help by storing transients in the RAM but I need to know if I can prevent them from filling WP_Options first. Otherwise they will just fill our object cache and we will need more Ram.

    It’s a good idea and it can indeed help by storing transients in the RAM. However, you should also consider optimizing your database to handle a large number of transients.

    Furthermore, have you had the opportunity to switch over to the HPOS yet? By doing so, you’ll unlock the full potential of a quicker checkout experience for your customers. You can find all the detailed information you need about HPOS right here: https://woo.com/document/high-performance-order-storage/

    I hope this helps! If you have further questions, feel free to ask.

    Thread Starter Thomas Jarvis

    (@thomasjarvisdesign)

    @shameemreza Thank you for the detailed response.

    The issue here is with 116,000 variations/child products our Transient cache is filling up fast with these records. Therefore actually looking up the data from the original table will probably take less/same length of time than retrieving the data from transients.

    Is there a way to prevent these transients generating in the first place?

    I think the site will be faster without them but I cannot test this without being able to disable them.

    Regarding HPOS – See link below to major issue
    https://github.com/woocommerce/woocommerce/issues/41062

    Moving to HPOS will help speed up order processing but because there is no mechanism yet to remove the old data – It will still take an extended length of time to get data from the usual posts/post meta tables. Until we have a mechanism to remove the original orders from Posts/post meta the benefits of HPOS only affect orders and not general load times of data from the post/post meta tables. So I am in no rush to move to HPOS because it doesnt actualy reduce the size of the Post/Post meta tables. NOT YET anyway. I will look to enable HPOS though anyway I think we were waiting for two plugin developers to declare compatibility before we could activate it.

    let me know if you can provide me with a way to stop the transients. This is about how scalable wordpress can be.

    • This reply was modified 3 months, 2 weeks ago by Thomas Jarvis.
    Plugin Support Shameem (woo-hc)

    (@shameemreza)

    Hi @thomasjarvisdesign

    Thanks for reaching out and I understand your concern.

    However, to prevent these transients from being generated in the first place, you would require custom coding to modify the core functions of WooCommerce that set these transients. This is a complex task and could potentially cause issues with your site, so it’s recommended to have a professional developer handle this if you decide to proceed.

    Just so you know, we can’t provide support for coding or customization as per our support policy. Still, if you need help, we recommend asking development questions on the #developers channel of the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question.

    You can also seek help from the following:

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

    Thread Starter Thomas Jarvis

    (@thomasjarvisdesign)

    Can I raise a feature request to prevent these transients from generating as an option.

    This is a scalability issue with WooCommerce. Essentially generating thousands/millions of transients if it is one per variable!

    Saif

    (@babylon1999)

    Hello @thomasjarvisdesign,

    Can I raise a feature request to prevent these transients from generating as an option.


    Absolutely! Please feel free to share any suggestions you have on how to improve the handling of this directly on Github: https://github.com/woocommerce/woocommerce/issues/new/choose

    Cheers! :‎)

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.