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

Nginx PageSpeed Nginx Pagespeed - Downstream Caches / Nginx proxy_cache

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by buik, May 10, 2016.

  1. buik

    buik “The best traveler is one without a camera.”

    2,035
    527
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,682
    Local Time:
    6:15 AM
    Does anyone have a working Nginx Pagespeed - Downstream Caches configuration, using Nginx proxy_cache?


    Because Pagespeed rebuilds most of the resources via browser requests time over time it could be a bit slow.

    With Nginx proxy_cache you can cache Pagespeed optimized content like Varnish etc does.

    I already know Memcache, and the ability to speed up the Pagespeed proces a bit.
    Main problem also with Memcache is that it still rebuild the content at all time.
    Seems as it don'y use Memcache as Cache but as fast sidekick.

    any help appreciated

    Thanks,
     
  2. eva2000

    eva2000 Administrator Staff Member

    55,445
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,841
    Local Time:
    2:15 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  3. buik

    buik “The best traveler is one without a camera.”

    2,035
    527
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,682
    Local Time:
    6:15 AM
    Thanks for your reply.
    Pagespeed developer Otto van der Schaaf wrote on their forum, a time ago, that their example is seriously outdated. Therefore my request here on this forum for a fully working example. There site offers snippets but not a fully working example.

    Btw @eva2000 what is your experience with Downstream Caches vs non Downstream Caches, speed related?
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,445
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,841
    Local Time:
    2:15 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah that actually explains alot..

    I have ngx_pagespeed downstream caching enabled on centminmod.com cluster of servers following that example in official documentation and while it shows HIT for status of cache in debugging the cpu load is much higher on stress test than what i'd expected for proxy_caching typically so not entirely sure it's working 100%. Don't have time to troubleshoot it right now so left as is as my centminmod.com cluster involves 16+ VPS servers so can afford to share the cpu load anyway. IIRC there's like a total of 34-44 cpu cores in the cluster. Remember, ngx_pagespeed does improve page speed but does eat cpu and memory normally as there is no free lunch for page load speed.

    Unfortunately, downstream caching is something you'd have to figure out on your own as it's very involved (i.e. my config involves over 100+ lines of configuration) and may involve alot of troubleshooting etc. I spent like 9+ months working on what I have now :)

    There's no doubt if you can get it working, downstream proxy_cache config for ngx_pagespeed should in theory provider better scalability and slightly better speed than non-downstream cache based ngx_pagespeed

    FYI, the forums here use ngx_pagespeed too but without downstream caching :)
     
    Last edited: May 10, 2016
  5. buik

    buik “The best traveler is one without a camera.”

    2,035
    527
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,682
    Local Time:
    6:15 AM
    @eva2000 willing to share your config via PM?
    I don't need specific parameters. Its for the basic use of testing downstream caching via 1 test server.
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,445
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,841
    Local Time:
    2:15 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    prefer not to as it is mixed with other site specific setups like nginx lua code etc and divided into dozens of include files

    starting point would still be Configuring Downstream Caches  |  PageSpeed Module  |  Google Developers and work from there
     
  7. buik

    buik “The best traveler is one without a camera.”

    2,035
    527
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,682
    Local Time:
    6:15 AM