comet-cache icon indicating copy to clipboard operation
comet-cache copied to clipboard

Auto-Cache Engine: Add Configurable Option for auto_cache_max_time

Open jaswrks opened this issue 8 years ago • 2 comments

The auto_cache_max_time setting is available within Comet Cache, but it doesn't appear to have been exposed in the UI yet. See: https://github.com/websharks/comet-cache-pro/search?utf8=%E2%9C%93&q=auto_cache_max_time

This option should be configurable in order to work around script execution time limits on shared hosts; e.g., if your host doesn't allow a script to run for the default 900 second limit, you could change this to 30 seconds and at least avoid the PHP warnings in a log file.

jaswrks avatar Feb 18 '17 21:02 jaswrks

Short-Term Workaround

Create this directory and file: wp-content/mu-plugins/cc-tweaks.php

<?php // Requires PHP 5.4+
add_filter('comet_cache_options', function($options) {
    $options['auto_cache_max_time'] = '60'; // Must be 60 or higher.
    return $options;
});

jaswrks avatar Feb 18 '17 21:02 jaswrks

Noting this line in Comet Cache. I updated the above workaround to accommodate the 60 second minimum, which we should also do a review of when work on this issue begins.

In short, the workaround I posted previously with a max time of 30 seconds didn't work because Comet Cache (at this time) only applies the customization if it is 60 seconds or more.

jaswrks avatar Feb 21 '17 00:02 jaswrks