Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('shutdown', 'check_cache_size');
- function check_cache_size() {
- global $wp_object_cache;
- $stats = array();
- foreach ($wp_object_cache->cache as $group => $cache) {
- $stats[ number_format( strlen( serialize( $cache ) ) / 1024, 2 ) ] = $group;
- }
- krsort($stats);
- ?><pre style="margin:10%;"><?php
- echo "Total cache size: " . number_format( strlen( serialize( $wp_object_cache->cache ) ) / 1024, 2 ) . "\n";
- print_r($stats);
- ?></pre><?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement