• 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 7 months, 3 weeks ago by futureyoon.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @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?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

    (@futureyoon)

    OK. Thank you for the comment. @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 7 months, 3 weeks ago by futureyoon.
    • This reply was modified 7 months, 3 weeks ago by futureyoon.
    • This reply was modified 7 months, 3 weeks ago by futureyoon.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @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

    (@futureyoon)

    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 7 months, 1 week ago by futureyoon.
    • This reply was modified 7 months, 1 week ago by futureyoon.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘object cache’ is closed to new replies.