Transient names are restricted to 172 characters; the info held in a transient could be a lot, a lot bigger.
Beneath the hood, transients are saved in the identical desk as choices, and a few WordPress code manages their lifetimes and expiry. It is best to simply have the ability to retailer 1MB of information in a transient.
Autoloading
In response to a remark asking about autoloading:
NB: transients that by no means expire are autoloaded, whereas transients with an expiration time should not autoloaded. Take into account this when including transients that might not be wanted on each web page, and thus don’t should be autoloaded, impacting web page efficiency.
So so long as you set an expiry date, your transients will not autoload.
// Units a transient with a week-long lifetime.
set_transient( 'my_transient_name', $knowledge, WEEK_IN_SECONDS );