Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Slider996

    (@slider996)

    In maintenance mode WooCommerce accumulates about 50 transient options per hour. In Live mode WooCommerce accumulates well over 1000 transient options per hour with all countries blocked except USA. With other countries accessing the site the accumulation is significantly higher.

    What is the best way to manage this?

    One suggestion I found was to instruct robots not to hit the add-to-cart in your robots.txt file. This seems to have only marginally helped.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Transients are used for 2 things;

    1. Caching product data (per product there will be several)
    2. Caching catalog queries e.g. layered nav

    Yes they can grow based on visits and # of products, but this is more efficient than doing a query per page load per user. They will be flushed periodically.

    Thread Starter Slider996

    (@slider996)

    Mine don’t seem to flush. Or they grow faster than they flush. I was over 500,000 transient options and my site was grinding to a halt. If I delete transient options manually does that also delete customer cart data?

    Is there any way to slow the number of transient options generated from robot visits?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Transients are separate from carts, but they are both stored in the same table.

    Robot visits should not matter, because the cache will be valid for them and normal users.

    Were the rows all transients, or carts too? We do have an alternative cart system..

    Thread Starter Slider996

    (@slider996)

    I think they were all transients or at least most of them. They were cleared with the following query: DELETE FROM wp_options WHERE option_name LIKE (‘%\_transient\_%’) I am also using WP-Optimize to clear transient options.

    Once I added a line to the robots.txt file not to hit the add-to-cart it seemed to slow down the accumulation a bit.

    I also used country blocking to stop Baidu and Ahrefs from spidering. That seems to have slowed down the accumulation quite a bit more.

    I am mainly concerned whether deleting transient options on a regular schedule will also delete any customer cache data as well.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    It shouldn’t. You can use https://github.com/kloon/woocommerce-large-sessions to be sure it won’t. We’re looking for feedback on that for possible core inclusion.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Transient options being created by WC’ is closed to new replies.