Automatic Platform Optimization Enabled & I No Longer See Visitor IP?

Just rebumping as it’s Wednesday
:+1:

I hope it will be fixed today.

If it’s any help, I’m finding this passes along an IPv6 address even when the client from which I’m connecting definitely has none.

The server upon which I’m running the cloudflare plug-in also doesn’t not have an IPv6 address, though Obviously I understand that’s not an issue.

Anyway, I hope that helps, and I hope we’re still on for a fix.

Thanks for all your work!

from @yevgen that IPv6 address is the Cloudflare IP used for the CF Worker subrequest

correct, we have a fix for this, pending a release to go it live.

4 Likes

Got it! Now I get the real user’s IP! Thank you.

1 Like

I am confirming that we’re seeing this as well. Thanks!

Can also confirm that it’s working for me. Thanks!

Both CF-Connecting-IP and X-Forwarded-For should contain real user IP.

8 Likes

Can you confirm you have now fully released the fix?

yes, it’s live.

3 Likes

Yep working great now, have marked this post as the solution.
Thanks!
Am seeing a noticeable speed increase.

1 Like

Thanks Cloudflare team! This feature is working fantastic. I’m seeing some drastic improvement on several sites where we’ve implemented it. It seems the more help a site needs, the more improvement it gets from APO. Sites that are already loading in the 3-4 sec range don’t see much improvement, but sites over 8-12 seconds are now dropping to 4-6 seconds!

1 Like

Yes confirmed working like a charm now.
Awesome guys, very much appreciated that you did look into this, after our remarks.
This shows Cloudflare really cares <3 about the community.

1 Like

Again 2a00:1fa1:c4b0:2733:0:5d:b898:e901, 2a00:1fa0:46dc:7425:6cec:d040:c876:d4fb :frowning:

Found this in our new relic:

Stack trace
E_WARNING: Cannot modify header information - headers already sent
in header called at /home/staging/public_html/wp-content/plugins/cloudflare/src/WordPress/Hooks.php (314)
in CF\WordPress\Hooks::initAutomaticPlatformOptimization called at /home/staging/public_html/wp-includes/class-wp-hook.php (287)
in WP_Hook::apply_filters called at /home/staging/public_html/wp-includes/class-wp-hook.php (311)
in WP_Hook::do_action called at /home/staging/public_html/wp-includes/plugin.php (478)
in do_action called at /home/staging/public_html/wp-settings.php (546)
in require_once called at /home/staging/public_html/wp-config.php (98)
in require_once called at /home/staging/public_html/wp-load.php (37)
in require_once called at /home/staging/public_html/wp-cron.php (44)

this is cause our cron is running through WP_CLI

Went to:

public function initAutomaticPlatformOptimization()
    {
      // add header unconditionally so we can detect plugin is activated
      if (!is_user_logged_in() ) {
        header( 'cf-edge-cache: cache,platform=wordpress' );
      } else {
        header( 'cf-edge-cache: no-cache' );
      }
    }

Changed to:

public function initAutomaticPlatformOptimization()
    {
		if ( !defined( 'WP_CLI' )) 
		{
	        if (!is_user_logged_in() ) {
	          header( 'cf-edge-cache: cache,platform=wordpress' );
	        } else {
	          header( 'cf-edge-cache: no-cache' );
	        }
		} 
    }
1 Like

For me oddly since this issue was announced I am now seeing really fast speeds on my site with or without APO enabled.

TTFBs of around 70ms. I have even put Cloudflare into development mode, cleared my cache and still get these speeds. I can’t work it out. A few weeks ago I was seeing a TTFB of 1.55s (I checked screenshots).

The speeds are great of course, I’m just super confused as to what’s causing it if not APO and Cloudflare?

There are similar reports in plugin source repository, we will address the issue.

2 Likes

This is now fixed, thank you for raising the issue, and please make sure to always do so when you feel something is not working as expected.

2 Likes