• Resolved rooobreyes

    (@rooobreyes)


    Hi,

    As the title implies, both of the functions are not working even though they worked before.

    Below is the the function where I used the w3tc_flush_post, I also tried putting w3tc_flush_all for testing purpose inside but still doesn’t work.

    Meanwhile the manual purge using the admin bar works and on post/page purging.

    If needed we can provide the testing site for checking.

    – function.php

    function flush_courses_acf( $course_ids ) 
    {   
        $course_flushed_ids = [];
    
        if ( function_exists('w3tc_flush_post') )
        { 
            // Loop all courses IDs and purge
            foreach( $course_ids as $course )
            {
                $purge = get_field( 'course_flush_cache_sync', $course );
    
                if( $purge != 'off' )
                {
                    w3tc_flush_post( $course );
                    array_push( $course_flushed_ids, $course );
                }
            }
        }
    
      return $course_flushed_ids;
    }

    Regards,
    Rob

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rooobreyes

    Thank you for your question and I am happy to assist you with this.

    both of the functions are not working even though they worked before.

    The fact that it works when purging the cache via the admin bar means that the problem is with your custom function.
    Can you please share when have you noticed that it stopped working? Have you made any recent updates like PHP update?
    Thanks!

    Thread Starter rooobreyes

    (@rooobreyes)

    Hi @vmarko

    It was working before from version 2.1.1 then when we updated to the recent update it stopped working.

    We tried rolling back to the working version but no luck.

    As for PHP update, we didn’t do any updates at the moment and currently running version 7.14.18

    And for the custom function, I can confirm the the post_id is being sent on the w3tc_flush_post.

    Additional, we are using Disk cache for Page cache, APC on Database and object cache.

    Regards,
    Rob

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rooobreyes

    Thank you for the information.
    Let me make some tests and I’ll get back to you as soon as I have an answer.
    Thanks!

    Thread Starter rooobreyes

    (@rooobreyes)

    Hello @vmarko

    Thanks,

    Let me know if you want to have a look on our development site to diagnose the issue better.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rooobreyes

    Thanks for your patience.
    I’ve checked this and nothing has been changed in the recent releases that would cause this.
    Can you please have some more information about what actually happens and what is the expected behavior?
    Have you tried enabling the Purge log in W3TC settings or checked the debug log or server error log?
    THanks!

    Thread Starter rooobreyes

    (@rooobreyes)

    Hi @vmarko

    After the updating to the latest version, we noticed when we do an API sync cache are not being purged.

    The API updates the courses post type along with it’s corresponding woocommerce products and clears that course page.

    On that said API the w3tc_flush_post is then called by the API along with the posts IDs that should be purged.

    Here’s a screenshot of the json data returned by the API after a sync:
    https://prnt.sc/17t639r

    Have you tried enabling the Purge log in W3TC settings or checked the debug log or server error log?

    Yes we already tried this but no entry on the purge log after the sync and no errors on the server error logs which makes the issue hard to diagnose.

    BTW, we are on a multisite setup if that information also helps.

    Regards,
    Rob

    Thread Starter rooobreyes

    (@rooobreyes)

    Hi @vmarko

    Deleting the cache folder on wp-content, reinstalling the plugin and changing the caching method for Page Cache from “Disk: Basic” to “Disk: Enhanced” fixed the problem.

    Will continue monitoring if the issue persist or resurface.

    Thanks for the help so far.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rooobreyes

    Thank you for the information.
    Possibly some minor glitch after the update of the plugin.
    Please let me know if you continue to experience the issue.
    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘w3tc_flush_all and w3tc_flush_post not working’ is closed to new replies.