pantheon-systems / wp-redis

WordPress Object Cache using Redis.
https://wordpress.org/plugins/wp-redis/
GNU General Public License v2.0
226 stars 68 forks source link

Clearing cache from WP Admin #235

Closed Lunteer closed 5 years ago

Lunteer commented 5 years ago

This is probably not an intelligent questions so apologies in advance.

We are using a Wordpress network install. Is there a way to clear the redis cache within the WP Admin area? Is this for all users or just superadmins in the Network admin area?

Thanks in advance!

szepeviktor commented 5 years ago

Hello!

I hope you are using WordPress instead of Wordpress! :)

wp-redis is a WordPress conform drop-in, so flushing object cache by wp_cache_flush() is enough

It requires current_user_can( 'manage_options' )

danielbachhuber commented 5 years ago

Thanks @szepeviktor !

@Lunteer Feel free to reply with additional details if you have further questions.

Lunteer commented 5 years ago

@szepeviktor Thanks for the answer and thanks for the link! Just not clear if the cache would flush for the one site or the entire network. I thought wp_cache_flush() was the entire cache.

@danielbachhuber thanks for closing. I do consider the question answered just want some clarity on the network aspect.

szepeviktor commented 5 years ago

@Lunteer I've never met multisite, actually it is a no-go for me, something I should not try. So all my plugins are totally unaware of network/single site.

Lunteer commented 5 years ago

@szepeviktor Thanks. Hopefully someone else can come along and provide more info.

danielbachhuber commented 5 years ago

Just not clear if the cache would flush for the one site or the entire network. I thought wp_cache_flush() was the entire cache.

Yes: wp_cache_flush() flushes the entire cache. There isn't a way to flush the cache for an individual site.