[wp-hackers] Transients that are not re-used after their expiry are never garbage-collected

Otto otto at ottodestruct.com
Fri May 3 13:34:39 UTC 2013


Why would you have a transient with a unique key? Or a key that
changes? This sort of defeats the point of using a transient in the
first place.

Sounds to me like you should fix the code that is using transients incorrectly.

-Otto


On Fri, May 3, 2013 at 4:18 AM, David Anderson <david at wordshell.net> wrote:
> Hi,
>
> Just a heads-up for others who may not be aware of this - I was not until
> today, until I began to look at my options table with ~250,000 entries in it
> (after 2 months!)...
>
> WordPress does not garbage-collect transients unless you attempt to access
> them. This means that if you use transients with unique keys, or keys that
> are not expected to be used after a certain time (e.g. as access tokens),
> then they may never be purged.
>
> Here's a simple plugin to provide temporary relief until this is fixed in
> core:
> http://downloads.wordpress.org/plugin/artiss-transient-cleaner.1.1.zip
>
> Trac ticket for the issue:
> http://core.trac.wordpress.org/ticket/20316#comment:16
>
> Best wishes,
> David
>
> --
> WordShell - WordPress fast from the CLI - www.wordshell.net
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list