Want more timely Centmin Mod News Updates?
Become a Member

Nginx PageSpeed Nginx Pagespeed - Downstream Caches / Nginx proxy_cache

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

  1. bassie

    bassie Active Member

    548
    118
    43
    Apr 29, 2016
    Ratings:
    +362
    Local Time:
    10:27 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

    30,848
    6,904
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,394
    Local Time:
    7:27 PM
    Nginx 1.13.x
    MariaDB 5.5
  3. bassie

    bassie Active Member

    548
    118
    43
    Apr 29, 2016
    Ratings:
    +362
    Local Time:
    10:27 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

    30,848
    6,904
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,394
    Local Time:
    7:27 PM
    Nginx 1.13.x
    MariaDB 5.5
    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. bassie

    bassie Active Member

    548
    118
    43
    Apr 29, 2016
    Ratings:
    +362
    Local Time:
    10:27 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

    30,848
    6,904
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,394
    Local Time:
    7:27 PM
    Nginx 1.13.x
    MariaDB 5.5
    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. bassie

    bassie Active Member

    548
    118
    43
    Apr 29, 2016
    Ratings:
    +362
    Local Time:
    10:27 AM