• Resolved dependencyinjection

    (@dependencyinjection)


    Hello and thank you for such an easy caching solution!

    Is it possible to set the custom clean up interval, using PHP apply_filter maybe?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Svetoslav Vasev

    (@svetoslavvasev)

    Hello @dependencyinjection ,

    I’m glad to hear that you’re happy with our Speed Optimizer plugin!

    You can set a custom clean-up interval for the File-based caching by using the add_filter function. The clean-up interval value is stored in an option called siteground_optimizer_file_caching_interval_cleanup, and to change it, you can insert a snippet like the following one into the active theme’s functions.php file (or a plugin that is used to insert custom code into the site):

    add_filter('option_siteground_optimizer_file_caching_interval_cleanup', function($value) {
    return YOUR_CUSTOM_INTERVAL_IN_SECONDS;
    });

    The value is stored in seconds – for example, if you wish to set it to 1 hour, the snippet would look like this:

    add_filter('option_siteground_optimizer_file_caching_interval_cleanup', function($value) {
    return 3600;
    });

    Best Regards,
    Svetoslav Vasev

    Thread Starter dependencyinjection

    (@dependencyinjection)

    Hi Svetoslav, that’s amazing, thank you for the quick reply!

    Did it like this to make it 4 hours:

    add_filter(‘option_siteground_optimizer_file_caching_interval_cleanup’, function($value) { return 4 * HOUR_IN_SECONDS; });

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

You must be logged in to reply to this topic.