Discover Centmin Mod today
Register Now

WebPerf Cloudflare Cloudflare Wordpress Plugin Automatic Platform Optimization

Discussion in 'Web Development & Web Performance' started by eva2000, Oct 2, 2020.

  1. Brad393

    Brad393 New Member

    11
    3
    3
    Oct 6, 2020
    Ratings:
    +7
    Local Time:
    2:50 AM
    My server access logs show HEAD requests from KeyCDN not GET when I use the performance tool for TTFB. The original Cloudflare edge cache script also required text/html type so APO may require both to fire the worker cache.

     
  2. eva2000

    eva2000 Administrator Staff Member

    47,898
    10,929
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,984
    Local Time:
    8:50 PM
    Nginx 1.21.x
    MariaDB 10.x
    Interesting, Cloudflare Wordpress plugin 3.8.3 was just released so maybe related? If you can post links to before versus after webpagetest.org results we can check too if you want

    Thanks for the confirmation on KeyCDN performance tests. Guess that isn't an ideal tool to test Cloudflare Automatic Platform Optimization based Wordpress caching :)
     
  3. negative

    negative Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    12:50 PM
    1.9.10
    10.1.11
    I'm using the APO for 2 days and website speed faster than before, i feel that as a visitor. That is better feeling than performance results i think.

    Only problem is that my query string URL's doesn't caching and still slower than real url's
     
  4. Brad393

    Brad393 New Member

    11
    3
    3
    Oct 6, 2020
    Ratings:
    +7
    Local Time:
    2:50 AM
    Instead of APO, you can set up a custom worker and use the original script here cloudflare/worker-examples it will cache the pages with querystrings too so subsequent hits to the same querystring are served from cache. I confirmed this working on a domain I have had that script on for 1 year+. It will cost more than the flat $5 for APO depending on your traffic though because workers are charged for resources used over the included baseline.

    eva2000 has a secret worker that does this too but, he doesn't want to share it yet :cry: ha
     
    Last edited: Oct 7, 2020
  5. eva2000

    eva2000 Administrator Staff Member

    47,898
    10,929
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,984
    Local Time:
    8:50 PM
    Nginx 1.21.x
    MariaDB 10.x
    Yes if you do use your own CF Worker it will be billing as US$5/month CF Worker plan only covers first 10 million requests and additional requests via CF Worker is US$0.5 per 1 million requests or US$5/10 million requests. Example, my own CF Worker costs for around 90 million requests/month = $5 + (80 x 0.5) = US$45/month. While CF APO is flat fee of US$5/month regardless of requests made.

    I was hoping CF Birthday week was to announce CF Worker prices to $5 per 100 million requests LOL - I pray in future it does happen :)

    Yeah I couldn't get that example to work for me hence I had to look at alternatives :)
     
  6. Brad393

    Brad393 New Member

    11
    3
    3
    Oct 6, 2020
    Ratings:
    +7
    Local Time:
    2:50 AM
    It did go through several revisions but has been working well for me. If you use a disk cache plugin with WP though the worker won't see the Cloudflare plugin header like stated. Then it will operate in a Cache Hit and async Refresh to origin mode which won't actually reduce server load but, still gives a speed up to users.
     
  7. eva2000

    eva2000 Administrator Staff Member

    47,898
    10,929
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,984
    Local Time:
    8:50 PM
    Nginx 1.21.x
    MariaDB 10.x
    Ah I actually pin point the date I tried this it was on Patrick's github repo not official Cloudflare one so probably the code diverged or wasn't same - it was around the time I asked about API Token support Update to support CF API Tokens ? · Issue #7 · pmeenan/cf-workers ~1yr + 1 month ago !
     
  8. negative

    negative Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    12:50 PM
    1.9.10
    10.1.11
    I see the problem about comments on wordpress blog.

    After enabled the APO, i don't see any comment awaiting approval or approved in panel. Also i've tried it as guest on different browser and yes, comments doesn't post i thought.

    Anyone experienced that problem ?
     
  9. eva2000

    eva2000 Administrator Staff Member

    47,898
    10,929
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,984
    Local Time:
    8:50 PM
    Nginx 1.21.x
    MariaDB 10.x
    That's a new one. Haven't heard about that as I use Disqus for Wordpress comments and don't have problems. If you have problems with Automatic Platform Optimization and Wordpress comments, I would report the problem on their support forums Cloudflare Community
     
  10. negative

    negative Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    12:50 PM
    1.9.10
    10.1.11
    Yes, problem is for wordpress internal comment feature.
    And i disabled the APO immediately until fixing.
     
  11. eva2000

    eva2000 Administrator Staff Member

    47,898
    10,929
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,984
    Local Time:
    8:50 PM
    Nginx 1.21.x
    MariaDB 10.x
    looks like other folks reporting the same errors on the official Cloudflare Wordpress plugin Github repo issue tracker at Cannot modify header information · Issue #302 · cloudflare/Cloudflare-WordPress and PHP warnings with wp-cron.php invoked with crontab · Issue #305 · cloudflare/Cloudflare-WordPress
     
  12. negative

    negative Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    12:50 PM
    1.9.10
    10.1.11
    Any report about internal comment module of wordpress?
     
  13. eva2000

    eva2000 Administrator Staff Member

    47,898
    10,929
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,984
    Local Time:
    8:50 PM
    Nginx 1.21.x
    MariaDB 10.x
  14. eva2000

    eva2000 Administrator Staff Member

    47,898
    10,929
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,984
    Local Time:
    8:50 PM
    Nginx 1.21.x
    MariaDB 10.x
    Strange I dug deeper, KeyCDN Performance test does do GET request for me but without text/html mime request. I logged to custom nginx log the $http_accept request header so I can see and my manual request to ?fbclid query string URL with nginx 302 redirect shows my manual request shows the Accept text/html request via GET. While KeyCDN Performance tool uses GET request ith empty Accept logged header = "*/*"
    Code (Text):
    grep fbclid cfssl-access.log
    
    xxx.xxx.xxx.xxx - - [08/Oct/2020:17:10:44 +0000] GET /?fbclid HTTP/1.1 "302" 138 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 OPR/71.0.3770.228" "xxx.xxx.xxx.xxx" "-" "1" "1" "0.000" 5df17a1bd207f27f-BNE 05aacaa5650000f27f91156000000001 TLSv1.3 TLS_AES_256_GCM_SHA384 "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
    
    172.105.189.11 - - [08/Oct/2020:17:13:48 +0000] GET /?fbclid HTTP/1.1 "302" 138 "-" "keycdn-tools/perf" "172.105.189.11" "-" "10" "1" "0.000" 5df17e9865dc16e1-SYD 05aacd733d000016e12c93e000000001 TLSv1.3 TLS_AES_256_GCM_SHA384 "*/*"
    
     
  15. Brad393

    Brad393 New Member

    11
    3
    3
    Oct 6, 2020
    Ratings:
    +7
    Local Time:
    2:50 AM
    Are you sure? There is a facebook querystring in your GET requests which is really weird, more like someone scraping KeyCDN public log of tests and then reposting it and it getting following or something else strange.

    When I run the performance test for KEYCDN and then immediately go to my logs, I see like 10 entries with HEAD requests like this:
    Code (Text):
    "HEAD / HTTP/1.1" 200 0 "-" "keycdn-tools/perf"
    
     
  16. eva2000

    eva2000 Administrator Staff Member

    47,898
    10,929
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,984
    Local Time:
    8:50 PM
    Nginx 1.21.x
    MariaDB 10.x
    that is me testing the URL with ?fbclid to bypass 1st request caching so I can log to my origin nginx log the request

    maybe query string requests use GET and non-query string use HEAD ?

    Either way HEAD or GET, without text/html Accept header, APO cache will be bypassed
     
  17. rdan

    rdan Premium Member Premium Member

    5,141
    1,282
    113
    May 25, 2014
    Ratings:
    +1,966
    Local Time:
    6:50 PM
    Mainline
    10.2
    I think you mean "is in the list" ?
     
  18. rdan

    rdan Premium Member Premium Member

    5,141
    1,282
    113
    May 25, 2014
    Ratings:
    +1,966
    Local Time:
    6:50 PM
    Mainline
    10.2
    Okay after reading and testing... it's still being cached, which is nice.
     
  19. eva2000

    eva2000 Administrator Staff Member

    47,898
    10,929
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,984
    Local Time:
    8:50 PM
    Nginx 1.21.x
    MariaDB 10.x
    depends on the query string as select query strings are now included in cache.
     
  20. omrtozd

    omrtozd New Member

    16
    7
    3
    Feb 16, 2021
    Ratings:
    +11
    Local Time:
    1:50 PM
    I followed the full-page caching guide to set up my Wordpress website. Should I use APO?