• Resolved fokus3

    (@fokus3)


    Hi,

    I tried to bypass the cache with some custom options. Here I found the filter “bypass_cache”. I created an action, but this action is never been called.

    Is it possible that it isn’t fully implemented or is it a bug? How can I get it to work?

    best regards,
    Lars

Viewing 3 replies - 1 through 3 (of 3 total)
  • codyarsenault

    (@codyarsenault)

    Can you clarify your use case? Are you looking to use the DONOTCACHEPAGE constant as discussed in this support thread? https://www.ads-software.com/support/topic/how-to-exclude-cpt-archive-from-cache/

    Thread Starter fokus3

    (@fokus3)

    it’s prety simple what I did. I placed code into the functions.php like this:

    	add_action( 'bypass_cache', 'my_bypass_cache' );
    	function my_bypass_cache() {
    	    error_log("xxx");
    
    	    return false;
    	}
    

    I have to check if a cookie or if a special $_REQUEST variable is set. So the DONOTCACHEPAGE option is not feasible.

    codyarsenault

    (@codyarsenault)

    Can you try using add_filter instead of add_action? Adding:

    function my_bypass_cache() {
        error_log("xxx");
    
        return false;
        }
    add_filter( 'bypass_cache', 'my_bypass_cache' );

    to the functions.php file results in an entry in the debug.log file upon visiting the site.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filters ‘bypass_cache’ not working’ is closed to new replies.