wp-graphql-cache icon indicating copy to clipboard operation
wp-graphql-cache copied to clipboard

Can't setup cache

Open PaulBouisset opened this issue 4 years ago • 0 comments

Hi, thanks for the plugin that what I was looking for but I have trouble to set it up.

I followed the readme and activated the plugin, then I put this code snippet in functions.php but nothing happens:

use WPGraphQL\Extensions\Cache\CacheManager;

CacheManager::register_graphql_query_cache([
    'query_name' => '*',
    'expire' => 120, // sec
]);

I also saw that if I run this it throws an error saying that CacheManager is null.

use WPGraphQL\Extensions\Cache\CacheManager;
CacheManager::clear()

Am I missing a step for the setup?

PaulBouisset avatar Feb 19 '21 14:02 PaulBouisset