wpsharks / comet-cache

An advanced WordPress® caching plugin inspired by simplicity.
https://cometcache.com
GNU General Public License v3.0
77 stars 18 forks source link

Auto-Cache Engine: Add Configurable Option for auto_cache_max_time #876

Open jaswrks opened 7 years ago

jaswrks commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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.