Welcome to Centmin Mod Community
Register Now

Nginx PageSpeed Redis + Pagespeed

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Matt Williams, Dec 17, 2015.

  1. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    3:26 PM
    latest
    10
    Running some tests with Redis + Pagespeed and I notice that when redis caches the page - Pagespeed does not get into that cached file with redis when looking at redisadmin.

    How would you combine both so redis caches the Pagespeed file or does it matter? I would think it does because CDN + Redis + Pagespeed is magical!
     
  2. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,750
    Local Time:
    5:26 AM
    Nginx 1.13.x
    MariaDB 5.5
    is the pagespeed optimised and rewritten file resources on the main domain or a cdn alias/cname domain ?

    pagespeed's own cache involves giving no-cache or max-age=0 headers so that it can on the fly alter and optimise the rewritten resources so maybe redis can't or doesn't pick them up because of this ?
     
  3. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    3:26 PM
    latest
    10
    ok - That makes sense then because viewing the /pagespeed_global_admin - Pagespeed is working as it should just not getting cached but since it max-age=0 that would make total sense
     
    • Like Like x 1
  4. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    3:26 PM
    latest
    10
    It's on both: Listed in PS Admin
    Should these be in the PS Edit as well? Seems like I could only get the domain lawyer to work when it was listed in the "admin"

    What do you suggest I try?
     
  5. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,750
    Local Time:
    5:26 AM
    Nginx 1.13.x
    MariaDB 5.5
    pscontrol edit for pagespeed.conf is only place these should be located for
    Code:
    pagespeed Domain domain.com;
    pagespeed Domain cdn.domain.com;
    
    pagespeed LoadFromFile "domain.com" "/home/nginx/domains/domain.com/public";
    pagespeed LoadFromFile "cdn.domain.com" "/home/nginx/domains/domain.com/public";
     
  6. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    3:26 PM
    latest
    10
    Can you change the Cache max age for Pagespeed? It's stored in Memcached right?

    Having a hard time implementing Redis + PageSpeed - How can I get PageSpeed to cache with Redis?
     
  7. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,750
    Local Time:
    5:26 AM
    Nginx 1.13.x
    MariaDB 5.5
    you can't use ngx_pagespeed with redis cache at nginx level as ngx_pagespeed sets cache control to private and max-age=0

    ngx_pagespeed for backend memached is only supported cache in ram storage option for it no redis support. They are working on using redis as a backend storage cache for ngx_pagespeed Support Redis as caching backend · Issue #777 · pagespeed/ngx_pagespeed · GitHub but not for front end redis cache compatibility at nginx level

    it's one or the other, ngx_pagespeed for faster page load speeds but may not scale or for redis cache for better scalability but may not be fastest in terms of page load speed. HTTP/2 may help with the page load speed though :)
     
    Last edited: Dec 25, 2015
  8. dorobo

    dorobo Active Member

    420
    104
    43
    Jun 6, 2014
    Ratings:
    +161
    Local Time:
    3:26 AM
    latest
    latest
    so you also can't combine gzipping a page and letting redis serve it at the nginx level?

    or can you use wp super cache and then redis on the wordpress level? I think this was addressed before but I don't know where to look.
     
  9. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,750
    Local Time:
    5:26 AM
    Nginx 1.13.x
    MariaDB 5.5
    gzip is fine with redis nginx level
    redis nginx level works fine with wp super cache or keycdn cache enabler plugins
     
  10. ModeltogTossen

    ModeltogTossen I wish I could??

    313
    97
    28
    Dec 20, 2015
    Denmark
    Ratings:
    +143
    Local Time:
    9:26 PM
    1.9.12
    10.0.23
    So with that statement I read it as - I have to chose between redis or pagespeed?
     
  11. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,750
    Local Time:
    5:26 AM
    Nginx 1.13.x
    MariaDB 5.5
    yes though for wordpress there's enough plugins around to do equivalent optimisations that ngx_pagespeed does so not really a loss
     
  12. ModeltogTossen

    ModeltogTossen I wish I could??

    313
    97
    28
    Dec 20, 2015
    Denmark
    Ratings:
    +143
    Local Time:
    9:26 PM
    1.9.12
    10.0.23
    So for someone like me - don't think about pagespeed and XF - and instead be using redis?
     
  13. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,750
    Local Time:
    5:26 AM
    Nginx 1.13.x
    MariaDB 5.5
    XF use Redis Cache XF Addon by @Xon as it's not on nginx level + ngx_pagespeed just like what i do on this very forum :)
     
    • Like Like x 1