Is there any danger in deleting all transients?

I have a big site for a client, and as it is a really customized wordpress installation with lots of extensions on functionality, I can’t use the caching plugins.

To improve the performance, I built a lot of the Site using transients (for example the navigation, the google maps with all the markers etc.), and leave the dynamic content dynamic.

The problem here is if I change anything, I have to manually delete the specific transient to see the current result. The site shows different menus and googlemaps when entered from a different channel, so I have like ten transients for each area.

Would you create a function where I delete those all at once (with a listing of the names of the transient), or is it okay to just delete all the transients on the site?

It’s not really that urgent, but for future ddevelopment I would like to know if you had any problems with stuff like that, and how you manage all your transients.

Cheers,
fischi

3 s
3

For development I would advise to always work with WP_DEBUG set to true and do the following:

$key = 'transient_key';
if( !WP_DEBUG && ( false !== ($transient = get_transient($key)) ){

   /* Generate transient manually */
   $expiration = 24*60*60;//How long to keep for
   set_transient($key,$transient, $expiration);
}

In general – it should be fine deleting transients, as they should never be assumed to be in the database.

Leave a Comment