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

Nginx PageSpeed If I'll try to use CDN

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by rdan, Aug 18, 2014.

  1. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    There's no need for me to use ngx_pagespeed?
    Does ngx_pagespeed will not work any more on those content server by cdn?
    Sorry but didn't use CDN since :)

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,564
    12,224
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,793
    Local Time:
    11:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah CDN served static files will bypass ngx_pagespeed by default. You can use MapOriginDomain and MapRewriteDomain to work with CDNs apparently but I haven't played with it much myself especially for https SSL origins and CDN as CDN with SSL custom certificates usually cost alot i.e. US$600/yr with Cloudflare and US$699/yr with cdn77.com

    PageSpeed Authorizing and Mapping Domains - PageSpeed Module — Google Developers

     
    Last edited: Aug 18, 2014
  3. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    CDNify is free for Custom SSL :)
    Might be better than Cloudflare.
     
  4. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    I want to try 1 to 3 months, I got this coupon from their support: AWESOMESPEED20
     
  5. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    BPC15SPEED
    15% Off Any Plan For First 3 Months
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,564
    12,224
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,793
    Local Time:
    11:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  7. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    I just signup, the provided sub domain/temporary domain works fine with https :)
    So I will just use it for now, just for testing.
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,564
    12,224
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,793
    Local Time:
    11:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Let us know how it goes :)
     
  9. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    Please advice, what should me the best settings here?
    Should i disable gzip? Why?
    upload_2014-8-18_2-52-48.png
     
  10. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    How can I apply this on my server?
    This is my temp CDN host name: phcorner.a.cdnify.io

    Code:
    pagespeed MapOriginDomain www.phcorner.net phcorner.a.cdnify.io;
    pagespeed MapRewriteDomain www.phcorner.net phcorner.a.cdnify.io;
     
  11. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
     
  12. eva2000

    eva2000 Administrator Staff Member

    54,564
    12,224
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,793
    Local Time:
    11:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    sweet thanks for sharing

    I decided to try this out with KeyCDN first as they have free trials with 25GB of free data during the trials and allow free custom SSL certificates you upload yourself

    with KeyCDN they are still missing SPDY for SSL but it's coming soon but free testing of ngx_pagespeed it's okay

    this is what i use

    Code:
    pagespeed Domain cdn.example.com;
    pagespeed LoadFromFile "https://cdn.example.com" "/home/nginx/domains/example.com/public";
    
     
  13. eva2000

    eva2000 Administrator Staff Member

    54,564
    12,224
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,793
    Local Time:
    11:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    trial and error there

    first one to stop index of cdn assest probably enable as to force ssl pulls try with and without
     
  14. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    WoW, they are almost half much cheaper than CDNify.
    If the micro plan is not enough for me, then I will transfer to KeyCDN, of course using your referral (y)

    I will try now your pagespeed code for CDN.

    I'm confuse here.

    But I force all my forum request to use https, so Maybe it's better to force also on my cdn settings :rolleyes:
     
  15. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    Implementing CDN my average load time increase a bit:
    upload_2014-8-19_14-36-29.png
     
  16. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    My config now:
    Code:
    # Custom for PHCorner.Net
    pagespeed LoadFromFile "http://www.phcorner.net" "/home/nginx/domains/phcorner.net/public";
    pagespeed LoadFromFile "https://www.phcorner.net" "/home/nginx/domains/phcorner.net/public";
    
    pagespeed Domain phcorner.a.cdnify.io;
    pagespeed LoadFromFile "http://phcorner.a.cdnify.io" "/home/nginx/domains/phcorner.net/public";
    pagespeed LoadFromFile "https://phcorner.a.cdnify.io" "/home/nginx/domains/phcorner.net/public";
    # End custom for PHCorner.Net
    But pagespeed not working on phcorner.a.cdnify.io resource like js,css,image.
     
  17. eva2000

    eva2000 Administrator Staff Member

    54,564
    12,224
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,793
    Local Time:
    11:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Nginx PageSpeed - Nginx Pagespeed Troubleshooting steps | Centmin Mod Community is your friend ;)

    yeah other thing is KeyCDN doesn't have SPDY SSL support yet
    That's why I said trial and error testing :)
     
  18. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    CDNify also temporarily disable SPDY due to maintenance, but it will be enable soon as they said.

    Did your ngx_pagespeed works fine with resources server by your CDN?

    I ask Keycdn support for a test IP of their Singapore, Hong Kong, japan and I got very slow ping with them.

    All the 3 small window is KEYCDN IP, and the big one is the current CDN i'm using which is CDNify.
    Usually Hong Kong and Singapore has 60-100 ping time to me, but with the IP keyCDN provided it's very slow.
    Screenshot from 2014-08-19 22:34:40.png
     
  19. eva2000

    eva2000 Administrator Staff Member

    54,564
    12,224
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,793
    Local Time:
    11:00 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah my KeyCDN ngx_pagespeed worked fine with what they called zonealiases so I setup a CNAME for custom.mydomain.com to their zone name zonename.keycdn.com and referenced custom.mydomain.com in my pagespeed.conf with the 2 settings I listed above and restarted nginx for pagespeed.conf to come into effect.

    Only thing I not too fond of with KeyCDN, is no SPDY SSL yet and the http headers list HIT from zonename.keycdn.com as opposed to HIT from custom.mydomain.com
     
  20. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    9:00 PM
    Mainline
    10.2
    Why not report it to them?