Support » Plugin: Super Page Cache for Cloudflare » Seem that your website is not behind Cloudflare.

  • Resolved diriras

    (@diriras)


    Hello,

    I have enough experience I think with this plugin as I have already installed in in 3 domains in a VPS server and its working flawlessly!

    A client asked me to increase the performance of the website above and I have installed it as usual, changed the dns to Cloudflare etc.
    I have Installed the plugin with usual auto settings and for 2 days now it keeps informing me when i test the cache that:

    Page caching seems not working for both dynamic and static pages.

    Error on dynamic page (…..): Seem that your website is not behind Cloudflare.

    Logs after the caching test:

    [2022-05-06 09:24:41] [cloudflare::page_cache_test] Start test to https://***** with headers Array
    (
        [timeout] => 10
        [sslverify] => 
        [user-agent] => Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0
        [headers] => Array
            (
                [Accept] => text/html
            )
    
    )
    
    [2022-05-06 09:24:48] [cloudflare::page_cache_test] Response Headers: Requests_Utility_CaseInsensitiveDictionary::__set_state(array(
       'data' => 
      array (
        'date' => 'Fri, 06 May 2022 09:24:41 GMT',
        'server' => 'Apache',
        'link' => '<https://****/wp-json/>; rel="https://api.w.org/", <https://****/wp-json/wp/v2/pages/1724>; rel="alternate"; type="application/json", <https://***/>; rel=shortlink',
        'cache-control' => 's-maxage=31536000, max-age=60',
        'x-wp-cf-super-cache' => 'cache',
        'x-wp-cf-super-cache-active' => '1',
        'x-wp-cf-super-cache-cache-control' => 's-maxage=31536000, max-age=60',
        'x-wp-cf-super-cache-cookies-bypass' => 'swfpc-feature-not-enabled',
        'set-cookie' => 
        array (
          0 => 'MOOSEND_SITE_ID=315562c9-bb7d-4fce-a9c7-9e531c54a229; path=/',
          1 => 'sessionid=4a6959cd7fd64308a6feefa44a6b4132; expires=Sat, 07-May-2022 09:24:47 GMT; Max-Age=86400; path=/',
          2 => 'MOOSEND_USER_ID=9859ab96e9e5406abc537cc27220ae24; expires=Mon, 03-May-2032 09:24:47 GMT; Max-Age=315360000; path=/',
        ),
        'upgrade' => 'h2,h2c',
        'content-type' => 'text/html; charset=UTF-8',
      ),
    ))
    [2022-05-06 09:24:48] [cloudflare::page_cache_test] Start test to https://****/wp-content/plugins/wp-cloudflare-page-cache/assets/testcache.html with headers Array
    (
        [timeout] => 10
        [sslverify] => 
        [user-agent] => Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0
        [headers] => Array
            (
                [Accept] => text/html
            )
    
    )
    
    [2022-05-06 09:24:48] [cloudflare::page_cache_test] Response Headers: Requests_Utility_CaseInsensitiveDictionary::__set_state(array(
       'data' => 
      array (
        'date' => 'Fri, 06 May 2022 09:24:48 GMT',
        'server' => 'Apache',
        'upgrade' => 'h2,h2c',
        'last-modified' => 'Wed, 04 May 2022 14:17:30 GMT',
        'accept-ranges' => 'bytes',
        'content-length' => '234',
        'content-type' => 'text/html',
      ),
    ))

    Cloudflare Page rules:

    https://******.gr/*
    Cache Level: Cache Everything

    I don’t know why the plugins cannot see the Cloudflare dns yet, every help is much appreciate!

    Regards, Michael

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Saumya Majumder

    (@isaumya)

    As I can see your site is properly behind Cloudflare. But the reason for cache BYPASS is that a lot of custom cookies are being set on the page load: https://i.imgur.com/bxgM7hA.jpeg

    Due to this the cache status is set to BYPASS. When Cloudflare sees custom cookies on a page, it does not cache that page as the cookie values might be used inside the site to load dynamic content.

    But when a page is served from cache the PHP doesn’t gets executed and hence content cannot be dynamically generated by PHP. This is why Cloudflare doesn’t cache pages which has custom cookies set in them.

    If you remove the plugin/services adding those custom cookies, your problem will be resolved.

    Thread Starter diriras

    (@diriras)

    hello,

    Thanks for you quick reply!
    Do you think that enabling Strip response cookies on pages that should be cached option should help instead of searching all the plugins of the website to find the correct one? I don’t have a clue which one is causing the problem!

    Update: I have find out that when I am enabling Strip response cookies on pages that should be cached</strong then the cart is not showing any products I have added before even if bypass caching is auto enabled for WooCommerce links and plugin!

    regards,

    • This reply was modified 7 months ago by diriras.
    Plugin Contributor Saumya Majumder

    (@isaumya)

    Do you think that enabling Strip response cookies on pages that should be cached option should help instead of searching all the plugins of the website to find the correct one? I don’t have a clue which one is causing the problem!

    – No it is not recommended as it will remove all the cookies and you might face problems like the one you faced on carts. So, better to drill down and figure out what’s adding those cookies and remove those plugins.

    Thread Starter diriras

    (@diriras)

    Thanks for your feedback.

    I have located the plugin and now as you see I don’t have cookies anymore https://imgur.com/a/0pcRYdi

    I still have the same error message when testing the cache thought!

    https://imgur.com/a/N3glRoj

    regards,

    Plugin Contributor Saumya Majumder

    (@isaumya)

    You can igmnore that. Sometimes that test shows false negative, but your caching is now working properly: https://i.imgur.com/vonpvXP.jpeg

    Thread Starter diriras

    (@diriras)

    Thanks for the support!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Seem that your website is not behind Cloudflare.’ is closed to new replies.