Can I force get_option to go back to the DB instead of cache?

Is there any way to guarantee that when I call get_option I will definitely get the value from the database and not from cache?

2 Answers
2

You could delete an existing cache for your option before you call get_option():

$GLOBALS['wp_object_cache']->delete( 'your_option_name', 'options' );
$value = get_option( 'your_option_name' );

Leave a Comment