Title: object cache
Last modified: April 3, 2024

---

# object cache

 *  [futureyoon](https://wordpress.org/support/users/futureyoon/)
 * (@futureyoon)
 * [2 years ago](https://wordpress.org/support/topic/object-cache-18/)
 * Hi
 * I would like to check if I need to enable wp-cron in order for “lifetime of cache
   objects” and “Garbage collection interval” to work?
 * or it will work without the wp-cron enabled?
 * plus, is there a way to check if above 2 metioned jobs have run or not?
 * Please advise me on this.
 * Thank you
    -  This topic was modified 2 years ago by [futureyoon](https://wordpress.org/support/users/futureyoon/).

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

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [2 years ago](https://wordpress.org/support/topic/object-cache-18/#post-17547821)
 * Hello [@futureyoon](https://wordpress.org/support/users/futureyoon/)
 * Thank you for reaching out and I am happy to help!
   The Garbage collection interval
   is dependent on the cron job and it’s used only when the Object Caching is set
   to Disk. This sets w3_objectcache_cleanup to run every hour (default value) The
   lifetime of cache objects is not using a cron job.
 * You can install and activate the [WP Control](https://wordpress.org/plugins/wp-crontrol/)
   plugin and Upon activation, you need to visit the **Tools » Cron Events** page
   to control cron settings.
 * You will see a list of all cron events scheduled to run on your site using the
   WordPress cron system.
 * In the first column, you will see the name of the hook that runs the cron, in
   this case, w3_objectcache_cleanup if, and I repeat, you are using Disk as a caching
   method, which in general should be avoided and you should consider using memory-
   based caching like Redis or Memcached.
 * Thanks!
 *  Thread Starter [futureyoon](https://wordpress.org/support/users/futureyoon/)
 * (@futureyoon)
 * [2 years ago](https://wordpress.org/support/topic/object-cache-18/#post-17548154)
 * OK. Thank you for the comment. [@vmarko](https://wordpress.org/support/users/vmarko/)
 * That means..
 * Q1: If I used Object Caching to Redis, garbage collection interval will not happen
   at all? or it will happen, but just that it’s not done by cronjob?
 * Q2: And you mentioned ‘lifetime of cache objects’ is not using a cron job, I 
   guess then it has own clock to kick off the job somehow. right? 
   Q3: A question
   is… is there a way to check if above 2 mentioned jobs have run anywhere from 
   the system?
 * Please kindly advise.
 * Thank you
    -  This reply was modified 2 years ago by [futureyoon](https://wordpress.org/support/users/futureyoon/).
    -  This reply was modified 2 years ago by [futureyoon](https://wordpress.org/support/users/futureyoon/).
    -  This reply was modified 2 years ago by [futureyoon](https://wordpress.org/support/users/futureyoon/).
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [2 years ago](https://wordpress.org/support/topic/object-cache-18/#post-17548280)
 * Hello [@futureyoon](https://wordpress.org/support/users/futureyoon/)
    1. Garbage collection interval etting defines the time interval at which W3 Total
       Cache scans for and removes expired object cache data stored on disk. If Redis
       is used, there is nothing saved on the disk so the GC interval will not kick
       in.
    2. Default lifetime of cache objects setting sets the default timeframe in which
       cached objects remain stored in memory before being considered outdated and 
       refreshed. This is used when using memory-based caching like Redis
    3. You can check the all cron jobs using the plugin or wp-cli and when you navigate
       to your wo application type wp cron event **list**
       As for the lifetime of cache
       objects, you can check the Redis log if using redis.Thanks!
 *  Thread Starter [futureyoon](https://wordpress.org/support/users/futureyoon/)
 * (@futureyoon)
 * [2 years ago](https://wordpress.org/support/topic/object-cache-18/#post-17683970)
 * sorry i came back late. Thank you for the update.
 * Just a suggestion
 * You can put a note at “Garbage collection interval” area that this will work 
   only when ‘Disk’ is selected.
 * Other than that, I am clear with all other answer except one below.
 * I am using Redis for object cache.
 * so do I need to turn on the cronjob in order for this “Default lifetime of cache
   objects” job to work? or without turning on the cron job (define( ‘DISABLE_WP_CRON’,
   true );), this will automatically flush the object cache?
 * Please kindly confirm. Thank you
    -  This reply was modified 2 years ago by [futureyoon](https://wordpress.org/support/users/futureyoon/).
    -  This reply was modified 2 years ago by [futureyoon](https://wordpress.org/support/users/futureyoon/).

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

The topic ‘object cache’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [cronjob](https://wordpress.org/support/topic-tag/cronjob/)
 * [interval](https://wordpress.org/support/topic-tag/interval/)

 * 4 replies
 * 2 participants
 * Last reply from: [futureyoon](https://wordpress.org/support/users/futureyoon/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/object-cache-18/#post-17683970)
 * Status: not resolved