I’m using WordPress and developed some site-specific plugins for it, additionally my theme is customized to fit the requirements of the plugins in the backend.
The last days I fiddled with transients in WordPress. In some tutorials they’re saying “If your’re using custom queries and their results are cachable: Use a transient“. Sounds good but I’m wondering when to use transients to get a real advantage.
I mean, even when using transients there have to be at least two queries in the background, haven’t it? The first one for checking the validity, second one for the transient itself.
So is it really useful to use a transient i.e. for a custom WP_Query?
Thanks a lot for your help and thoughts.
Seems fairly straightforward. It’s a literal class helper that allows you to store objects in a ‘memcache’ type fashion. You first set the transient
Now that we have created our trigger and bound it to the name of ‘$key’, we can access it anytime by using the exact value that key implies (which we declared earlier).
By utilizing this format you can hold queries in a ‘cache’ like world and use them to generate your responses. This is similar in a way to using ‘trigger’ events in MySql. Infact, this is a PORTION of a TECHNIQUE commonly referred to as long polling.