Title: Cache size
Last modified: February 13, 2022

---

# Cache size

 *  Resolved [zyzz3031](https://wordpress.org/support/users/zyzz3031/)
 * (@zyzz3031)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cache-size-11/)
 * hi,
 * my cache size changes nearly every day by itself and i dont know why. i talked
   to my webhoster and they said, that they dont do any caching.
 * so why does this plugin change its cache size all the time when nothing from 
   my homepage changes?
 * i set it to renew every 2 months and when i clear and reload the cache myself,
   it says the correct size every time

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Harshad](https://wordpress.org/support/users/bornforphp/)
 * (@bornforphp)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cache-size-11/#post-15365628)
 * [@zyzz3031](https://wordpress.org/support/users/zyzz3031/) Could you please try
   to add the following code to your active child theme’s functions.php file and
   check if it helps to fix the issue?
 *     ```
       add_action('init','purge_cache');
   
       function purge_cache(){
       if ( function_exists( ‘WP_Optimize()->get_page_cache()->purge’ ) ) {
       WP_Optimize()->get_page_cache()->purge();
       }
       }
       ```
   
 *  Thread Starter [zyzz3031](https://wordpress.org/support/users/zyzz3031/)
 * (@zyzz3031)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cache-size-11/#post-15366269)
 * i added the code on the bottom of the functions.php file and saved, then my site
   crashed and didnt work anymore
 * what have i done wrong?
 *  [Harshad](https://wordpress.org/support/users/bornforphp/)
 * (@bornforphp)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cache-size-11/#post-15367013)
 * [@zyzz3031](https://wordpress.org/support/users/zyzz3031/) Can you please enable
   debugging mode, Please add following lines to wp-config.php just before where
   it says: /* That’s all, stop editing! Happy publishing. */
 *     ```
       define( 'WP_DEBUG', true );
       define( 'WP_DEBUG_DISPLAY', false );
       define( 'WP_DEBUG_LOG', true );
       ```
   
 * Then try to reload the page.
 * A debug.log file should be created inside wp-content folder,which should contain
   error information in it, Please share the file with us.
 *  [Harshad](https://wordpress.org/support/users/bornforphp/)
 * (@bornforphp)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/cache-size-11/#post-15421203)
 * [@zyzz3031](https://wordpress.org/support/users/zyzz3031/) The correct code should
   be
 *     ```
       add_action('init','purge_cache');
   
       function purge_cache(){
       	if (is_callable(array(WP_Optimize()->get_page_cache(), 'purge'))) {
       		WP_Optimize()->get_page_cache()->purge();
       	}
       }
       ```
   
 *  Thread Starter [zyzz3031](https://wordpress.org/support/users/zyzz3031/)
 * (@zyzz3031)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/cache-size-11/#post-15425715)
 * hi,
    i added the new code, but it does nothing. only new thing is, that under
   cache, the size and file count always stays at 0.
 * and i already before, every time i manualy load the cache, the first time i click
   the button i get the error message: an unexpecter request was received
 *  [Harshad](https://wordpress.org/support/users/bornforphp/)
 * (@bornforphp)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/cache-size-11/#post-15426824)
 * [@zyzz3031](https://wordpress.org/support/users/zyzz3031/) At the first attempt
   you see “an unexpecter request was received” but if you click the Preload button
   again it will preload the urls.
 *  Thread Starter [zyzz3031](https://wordpress.org/support/users/zyzz3031/)
 * (@zyzz3031)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/cache-size-11/#post-15426946)
 * Yes it will preload the cache if i click it another time.
    But the thing is, 
   when i preload the cache the fist time, it never has the right amount. For excample:
 * I clear the cache, then preload.
    It says. 1mb 10 files
 * After clearing and preloading again it says. 2,5mb and 55 files.
 * And when i repeat that process again, it keeps telling me 2,5mb and 55 files.
   So thats the right cache.
 * But this problem was already before your code i tried.
 * And my main problem was/is that after the coreect cache size is loaded after 
   the second attempt, i dont make any changes to the site. No plugins updates or
   any changes to the page, and every day the cache says some different size.
 * Sometimes its 17mb and 200 files, the next day its 0.3mb and 2 files….
 * I really dont get it whats wrong.
 * If you want, you can have access to the site and see for yourself
 *  Thread Starter [zyzz3031](https://wordpress.org/support/users/zyzz3031/)
 * (@zyzz3031)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/cache-size-11/#post-15436269)
 * I have a second website at a different hoster and there is the same probleme.
   Site cache size changes everyday without the site changing anything.
 * Either i am to stupid to use this plugin and say cache the size and only reload
   everymonth or there is a big problem with your plugin

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Cache size’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [zyzz3031](https://wordpress.org/support/users/zyzz3031/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/cache-size-11/#post-15436269)
 * Status: resolved