• Resolved Tommy

    (@baptistej)


    Hello,

    I noticed the plugin is now storing TON of transients in the wp_options table, is it normal? I just deleted around 50k expired ones with WP optimize.

    _transient_10-lightbox-photoswipe-image

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    The expired transients should be deleted automatically – that’s the reason why they have a expire date. I wonder why this does not happen automatically. I have to check this.

    Thread Starter Tommy

    (@baptistej)

    Is it possible to store them in a different table? my wp_options table was 10 pages long but now it’s 450 pages. Might be caused by WP 6.0 or a new plugin version because I never noticed this before.

    Plugin Author Arno Welzel

    (@awelzel)

    Ok, I checked it in detail.

    First of all – having transients at all is completely OK since the plugin uses transients to cache the image metadata for up to 24 hours to improve performance, so the metdata for images (size, EXIF data etc.) does not have to be determined with every page request.

    If you have many images on your site, you may also have many transients since for each image one transients gets created if it is loaded. However, these transients should not cause any performance issue since they will not get loaded automatically due to their expiration date of about 24 hours after creation.

    Furthermore expired transients will get cleaned up by WordPress automatically. If this does not work on your site you should check if cron jobs are executed properly on your site. If possible, you may disable the internal cron execution and use a dedicated job for that.

    Also see: https://kinsta.com/knowledgebase/disable-wp-cron/

    Edit: you can also improve the performance by using a Redis database and Redis Object Cache – then all transients will be managed by Redis which can be much faster than a MySQL/MariaDB database.

    • This reply was modified 2 years, 6 months ago by Arno Welzel.
    • This reply was modified 2 years, 6 months ago by Arno Welzel.
    • This reply was modified 2 years, 6 months ago by Arno Welzel.
    Plugin Author Arno Welzel

    (@awelzel)

    About a different table:

    In the past the plugin used its own table. But this caused performance issues for some sites since only transients are processed by object caches and not content from a custom database table. By using transients performance is much better as you can use Redis or other object caches.

    Usually there is no need at all to manually browse the wp_options table. If you want to limit the result to “real” options only, use a statement like this:

    select * from wp_options where option_name not like '_transient%'

    Thread Starter Tommy

    (@baptistej)

    Ok thanks for the explanation, I think wp cron is running properly but I have a lot of image on my site that’s why there was so many expired transients.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Transient in wp_options’ is closed to new replies.