• Hi!

    I have been trying to set up a Cron Job on my Hostinger server, however without success.

    So I decided to use a PHP function as I used in WP Rocket, but the function has not worked, could someone help me with this case?

    My function taken from the WP Fastest Cache website:

    <? php
    // Load WordPress.
    require (‘wp-load.php’);

    // it clears all the cache
    if (function_exists (‘wpfc_clear_all_cache’)) {
    }

    // it clears all the cache with the minified sources
    if (function_exists (‘wpfc_clear_all_cache’)) {
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Emre Vona

    (@emrevona)

    did you write PHP code before?

    Thread Starter renanbernei

    (@renanbernei)

    Thanks for returning Emre.

    No, I never wrote php code.

    I tried to use the commands on the link : https://www.wpfastestcache.com/tutorial/delete-the-cache-by-calling-the-function/

    And as it didn’t work, I modified it, after that it works for a few hours and stops.

    <?php
    // Load WordPress.
    require( ‘wp-load.php’ );

    // it clears all the cache
    if ( function_exists( ‘wpfc_clear_all_cache’ ) ) {
    }

    // it clears all the cache with the minified sources
    if ( function_exists( ‘wpfc_clear_all_cache’ ) ) {
    }

    Thread Starter renanbernei

    (@renanbernei)

    Please could you help me make this code more accurate to perform a cleanup / preload function?
    ??

    Regards

    Plugin Author Emre Vona

    (@emrevona)

    you need to get a paid support from someone about it.

    What you can do is install the “WP Control” plugin to create cron jobs from WP admin panel.
    Then in the PHP cron job, just call “wpfc_clear_all_cache(true);”
    That’s it ??
    Edit: “true” arg is to purge the minified data too

    • This reply was modified 3 years, 8 months ago by ahnurbd.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Configure cron job to clear cache’ is closed to new replies.