Want to subscribe to topics you're interested in?
Become a Member

Sysadmin How to check that CloudFlare is working properly with PageSpeed?

Discussion in 'System Administration' started by RB1, Jan 30, 2017.

  1. RB1

    RB1 Active Member

    281
    72
    28
    Nov 11, 2016
    California
    Ratings:
    +119
    Local Time:
    6:23 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    I recently setup CloudFlare on one of my domains that also takes advantage of Nginx PageSpeed. I have Wordpress installed on the root directory as well as some other sub-folders hosting static content.

    Upon inspection of headers, I see:
    x-page-speed: 1.12.34.2-0
    server: cloudflare-nginx

    Cool, looks good.
    However, none of my static resources like images/css/etc appear to have been rewritten by PageSpeed i.e. check.png becomes xcheck.png.pagespeed.ic.v1ImpeEk3F.png,

    How do I know if CloudFlare is serving the non-optimized assets or if it is serving PageSpeed assets?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:23 PM
    Nginx 1.13.x
    MariaDB 5.5
    ngx_pagespeed rewritten resources take a few page loads to do so probably why. Use webpagetest.org and web browser developer tools network tab to reload your pages a few times i.e. 10+ reloads and see
     
  3. RB1

    RB1 Active Member

    281
    72
    28
    Nov 11, 2016
    California
    Ratings:
    +119
    Local Time:
    6:23 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    Yes I'm aware of this, but even after numerous reloads I don't see any PageSpeed specific assets.
    I will try to purge all Cloudflare cached content and maybe it will push the PageSpeed stuff to their servers?
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:23 PM
    Nginx 1.13.x
    MariaDB 5.5
  5. RB1

    RB1 Active Member

    281
    72
    28
    Nov 11, 2016
    California
    Ratings:
    +119
    Local Time:
    6:23 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    Hmm seems like a lot of errors
    - No permission to rewrite
    - HTTPCache key=... fragment=...: remembering recent failure for 247 seconds.
    - Could not rewrite resource in-place because URL is not in cache

    In pagespeed.conf I have
    Oh also...is PageSpeed only beneficial for return visitors or will the optimized images/file formats/js/css be served to first time visitors as well?
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:23 PM
    Nginx 1.13.x
    MariaDB 5.5
    see example of this forum's pagespeed.conf at https://community.centminmod.com/threads/this-forums-pagespeed-conf.62/

    don't need MapOriginDomain really

    did you configure memcached caching but have memcached server stopped ?

    once optimised resources, it helps for first time and repeat
     
  7. RB1

    RB1 Active Member

    281
    72
    28
    Nov 11, 2016
    California
    Ratings:
    +119
    Local Time:
    6:23 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    Code (Text):
    # service memcached status
    Memcached server is running

    Cool, good to know about the 1st time visitors :)
     
  8. RoldanLT

    RoldanLT Well-Known Member

    3,899
    949
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,298
    Local Time:
    9:23 PM
    1.11
    10.2
    Did you solve your issue now?
    Seems Cloudflare strip out "x-page-speed" header that's why pagespeed doesn't work.
     
  9. RB1

    RB1 Active Member

    281
    72
    28
    Nov 11, 2016
    California
    Ratings:
    +119
    Local Time:
    6:23 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    I don't think they are actually stripping the x-page-speed header. Here is a different site of mine on CF.

    HTML
    Code:
    X-Page-Speed: 1.12.34.2-0
    Cache-Control: max-age=0, no-cache
    Server: cloudflare-nginx
    CF-RAY: 3408j63jb2586dab-SKF
    Static Asset (PageSpeed optimized) ximg1.png.pagespeed.ic.Vs-V_tWz_E.webp
    Code:
    Content-Type: image/webp
    Access-Control-Allow-Origin: *
    Expires: Mon, 16 Apr 2018 17:24:52 GMT
    ETag: W/"0"
    Cache-Control: public, max-age=31536000
    X-Page-Speed: 1.12.34.2-0
    CF-Cache-Status: HIT
    Server: cloudflare-nginx
    CF-RAY: 3902f631243b9dba-SJC
    Edit: I actually don't know why this site is working with PageSpeed and Cloudflare and my other site isn't. :(
     
  10. RoldanLT

    RoldanLT Well-Known Member

    3,899
    949
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,298
    Local Time:
    9:23 PM
    1.11
    10.2
    Your pagespeed config looks like?
     
  11. RoldanLT

    RoldanLT Well-Known Member

    3,899
    949
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,298
    Local Time:
    9:23 PM
    1.11
    10.2
  12. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:23 PM
    Nginx 1.13.x
    MariaDB 5.5
    header hasn't nothing to do with whether ngx_pagespeed works.. judge it by rewritten page assets like css, js or optimised images
     
  13. RoldanLT

    RoldanLT Well-Known Member

    3,899
    949
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,298
    Local Time:
    9:23 PM
    1.11
    10.2
    Centmin.com doesn't work on my end for static files.
    It's part of pagespeed.
    https://modpagespeed.com/doc/configuration#XHeaderValue
     
  14. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:23 PM
    Nginx 1.13.x
    MariaDB 5.5
    works for me though

    upload_2017-4-17_4-4-57.png

    FYI, it may take more page reloads than normal as the centmin.com backend origin is staged across my centminmod.com geodns cluster of 16+ servers so you may hit a server which needs a few more page reloads for ngx_pagespeed to work it's magic
     
    Last edited: Apr 17, 2017
    • Like Like x 1
    • Informative Informative x 1