Skip to main content

Timeline for Are transients garbage collected?

Current License: CC BY-SA 3.0

11 events
when toggle format what by license comment
Mar 19, 2014 at 5:20 comment added Otto In my considered opinion, not specifying an expiration should throw a fatal error and break the site. But then I'm not in charge. A transient with no expiration is stupid and meaningless. If you want to use the object cache, then just use the object cache directly with the wp_cache functions. That said, there are tickets to have future version of WordPress clean up old transients, mainly because it's "unsightly" more than anything else.
Aug 1, 2013 at 1:02 comment added webaware Say, 7 days. If a plugin / theme author wants something bigger or smaller, they'll specify it. If they want autoload, they shouldn't have to specify 0 for expiration (= infinity), but that's what they've currently got with the expiration parameter doing double duty as the yes/no autoload parameter. Either way, default expiration shouldn't also lead to autoload=yes as default; that's just asking for trouble.
Jul 31, 2013 at 14:47 comment added Otto That depends. What would you consider a sensible default value there instead?
Jul 31, 2013 at 0:19 comment added webaware :) (because it's not because the WordPress default is wrong, eh?)
Jul 30, 2013 at 16:12 comment added Otto Well, the solution here is simple: Don't use those plugins. They're doing it wrong. Transients are not to be used as sessions, you should not use them without a meaningful expiration, and they should not have mutating or changing keys.
Jul 30, 2013 at 0:21 comment added webaware Also, not identical to an option, as it will be purged when using an object cache -- see recent article on WPEngine for details.
Jul 30, 2013 at 0:19 comment added webaware Sure, but it's the default. As such, many plugin authors are adding non-expiring transients.
Jul 29, 2013 at 23:43 comment added Otto There is no reason to use a "transient with no expiration", because that is basically identical to a normal "option".
Jul 29, 2013 at 0:48 comment added webaware NB: transients with no expiration do get autloaded, and no expiration is the default, so where an application / plugin is creating lots of transients and not setting an expiration they will be using chunks of memory on every page/post load.
Sep 12, 2011 at 18:16 history edited Otto CC BY-SA 3.0
added 207 characters in body
Sep 12, 2011 at 18:09 history answered Otto CC BY-SA 3.0