Skip to content

Commit

Permalink
fix faq code snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
tillkruss authored Dec 14, 2023
1 parent 447c8c3 commit e8a369e
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,13 @@ Alternatively, you can use a desktop client like [Medis](https://getmedis.com) o
If you don't see metrics building up, or your site is not getting faster, you might have an active plugin that flushes the object cache frequently. To diagnose this issue you can use the following snippet to find the source of the cache flush:

```php
add_action(
'redis_object_cache_flush',
function( $results, $delay, $selective, $salt, $execute_time ) {
ob_start();
echo date( 'c' ) . PHP_EOL;
debug_print_backtrace();
var_dump( func_get_args() );
error_log( ABSPATH . '/redis-cache-flush.log', 3, ob_get_clean() );
}, 10, 5
);
add_action( 'redis_object_cache_flush', function( $results ) {
ob_start();
echo date( 'c' ) . PHP_EOL;
var_dump( $results );
debug_print_backtrace();
error_log( ob_get_clean(), 3, ABSPATH . '/redis-cache-flush.log' );
}, 10, 5 );
```

Once you found the plugin responsible by checking `redis-cache-flush.log`, you can contact the plugin author(s) and reporting the issue.
Expand Down

0 comments on commit e8a369e

Please sign in to comment.