• Resolved zestpush

    (@dhaka11021)


    i have a website that update data on every 20 min so i want to set cache page lifespan to 15 min but wp optimize has no any option to do that it has only hours value

Viewing 5 replies - 1 through 5 (of 5 total)
  • @dhaka11021 At the moment there is no option to set lifespan to minutes the only option is set to hours.

    Plugin Contributor Venkat Raj

    (@webulous)

    @dhaka11021 You can use this filter wpo_option_key_page_cache_length to modify the cache life span

    
    add_filter('wpo_option_key_page_cache_length', 'my_prefix_page_cache_length');
    
    function my_prefix_page_cache_length() {
      return 60 * 15;
    }
    
    Thread Starter zestpush

    (@dhaka11021)

    I added this code to function.pho and set cache life span 0 in wp-optimize but not working

    Plugin Contributor Venkat Raj

    (@webulous)

    @dhaka11021

    If you set life span to 0, cache will be generated only you manually empty cache. This can be done in the UI itself.

    To set life span to 15 minutes or anything that is not possible with UI, you can use above code. One thing I forgot to mention is that you need to

    * Deactivate / Activate WP Optimize
    or
    * Install WP Crontrol and delete wpo_purge_old_cache event, so that new life span will take effect.

    Hi @webulous,

    When deleting wpo_purge_old_cache the hook just comes back immediately?

    How do I go about resolving this?

    Running the event: The cron event wpo_purge_old_cache could not be found.

    Screenshot: v

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to set cache life span to 15min’ is closed to new replies.