Friday, December 9, 2022
HomeWordPress Developmentplugins - Retailer giant dataset in WordPress set up momentary

plugins – Retailer giant dataset in WordPress set up momentary


Transient names are restricted to 172 characters; the info held in a transient could be a lot, a lot bigger.

set_transient() documentation

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 );

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments