• The message below fills the debug.log quite rapidly:

    Cannot modify header information - headers already sent in /wp-content/plugins/wp-cloudflare-page-cache/libs/cache_controller.class.php on line 206

    This is a fairly common issue with many plugins I’ve encountered. In this case changing the hook in ~line 49 seems to be working for me so far.

    // This fires on both backend and frontend and it's used to check for URLs to bypass
    //add_action( 'init', array($this, 'bypass_cache_on_init'), PHP_INT_MAX );
      add_action( 'template_redirect', array($this, 'bypass_cache_on_init'), PHP_INT_MAX ); 
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Salvatore Fresta

    (@salvatorefresta)

    Hi @alx359 ,
    ok but it’s not a correct way to fix it. The plugin needs to execute bypass_cache_on_init on init.

    There is probably something in your template that conflicts

    Thread Starter alx359

    (@alx359)

    Hi Salvatore, have checked my templates many times, but can’t find any odd symbols with any of them (spaces, CR, etc). The bypass_cache_on_init() is just inserting some headers, what do you think about using the send_headers hook instead?

    // This fires on both backend and frontend and it's used to check for URLs to bypass
    //add_action( 'init', array($this, 'bypass_cache_on_init'), PHP_INT_MAX );
      add_action( 'send_headers', array($this, 'bypass_cache_on_init'), PHP_INT_MAX );

    Anyway, for now adding output_buffering = On in .user.ini seems to also fix the issue, but have to test it more.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cannot modify header information: headers already sent’ is closed to new replies.