Changes won't reflect until cache is cleared

I am using WPDataTables to edit Appointments+ start & end times, but changes are not being reflected on the front-end until App+ cache is cleared.

Is there and easier way to clear appointements+ and cache upon a page refresh?

  • Adam Czajczyk

    Hello Wendy,

    I hope you're well and thank you for your question!

    I think in previous versions of Appointments+ plugin you could just disable its internal cache but now there's no such option. I see that Patrick has suggested using a function to clear the cache so I think you might try this:

    function wpmu_appointments_clear_cache() {
    add_action('wp_init', 'wpmu_appointments_clear_cache',11);

    To apply it to your site create an empty file with .php extension (e.g. "clear-appointments-cache.php"), paste that code inside (using "clean text" editor such as e.g. Sublime or Notepad++ or similar) and upload the file to the "/wp-content/mu-plugins" of your site. If there's no "mu-plugins" folder inside the "wp-content" folder, just create it.

    Let me know if that worked for you, please.

    Best regards,

  • Panos

    Hi Wendy ,

    Could you first try visiting wp-admin > Appointments > Advanced tab

    In the Advanced Settings page there is a checkbox for "Clear Cache"

    Check that box and then click save. This should be clearing cache. Note that after page reloads it will be unchecked again. That option is for clearing the cache when clicking the save button.

    If this doesn't help, you could try calling:

    appointments_delete_work_breaks_cache( $location, $worker_id );
    wp_cache_delete( 'app_working_hours' );

    in a hook provided by the WPDataTables plugin when it updates tables. Let us know if the first option works for you or not so we could have a llok on the WPDataTables hooks available.