[wp-trac] [WordPress Trac] #55969: The function set_transient should have the autoload argument

WordPress Trac noreply at wordpress.org
Mon Jun 13 05:33:02 UTC 2022

#55969: The function set_transient should have the autoload argument
 Reporter:  giuse        |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Database     |     Version:  6.0
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  performance

Comment (by giuse):

 > Temporary values should definitely not be autoloaded

 It makes sense, I would totally agree if the sentence was without
 "definitely". You may have some rare situations where you want the
 autoload also for this kind of transients. Why don't give me the
 possibility to choose? Imagine transients that expire after 1-2 months.
 For 1-2 months I want them autoloaded.
 You can't predict all the cases. It's perfect to have as default the
 autoload that has a sense for most cases, but why don't give the
 possibility to choose?
 If I don't explicitly assign the autoload parameter it would be as it is
 now, and if I assign it, it means that I need to assign it.

 Should permanent transients always be autoloaded? Also in this case, as a
 default yes, but you should be able to choose. You may need permanent
 transients that are not autoloaded. For example, permanent transients that
 run in the backend.

 I would assign it as a default as it is now, but give the possibility to
 change the autoload if needed. The same as you do with normal options.

Ticket URL: <https://core.trac.wordpress.org/ticket/55969#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list