How many transients is too many transients

I am using transients on my Wordpress site, and we may end up with more than 1,000,000 transients in the worst case situation. I think 500,000 is more likely, but I was wondering if having too many transients could cause some performance issues? We keep them for 1 year, because the same requests keep being made throughout the year repeatedly. I know in terms of storage it won't be much of an issue, because a single transient don't take up much space.

Topic transient Wordpress

Category Web


It depends if you add an expiration time. If you do not add an expiration time then autoload will be yes. This means the option that stores this transient will be loaded on every request even if it's not used. With large numbers of transients this poses an issue purely in terms of memory.

I would recommend installing an external object cache if you haven't, as it will make transients both more efficient, and significantly faster ( as well as most of WordPress ).

If not, then a dedicated table may be better given the length of time your transients will stick around, but a large number of transients shouldn't cause major issues if they have expiration dates.

It may actually be more efficient to implement caching on the API with the expensive endpoints rather than in the consuming WordPress install. You should contact their maintainers.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.