Get the most out of your Centmin Mod LEMP stack
Become a Member

Xenforo Possible the fast_cgi cache on xenforo 2.1.x ?

Discussion in 'Forum software usage' started by negative, Feb 1, 2020.

  1. nfn

    nfn New Member

    29
    0
    1
    Jun 28, 2015
    Ratings:
    +8
    Local Time:
    6:34 PM
    It will be faster of course, but measuring with webpagetest I got few ms faster, nothing that big
     
  2. eva2000

    eva2000 Administrator Staff Member

    44,417
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,692
    Local Time:
    3:34 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Yeah but again you're looking at latency response times in isolation. I'm more talking about high concurrency user load throughput based latency/throughput.
     
  3. negative

    negative Active Member

    384
    46
    28
    Apr 11, 2015
    Ratings:
    +90
    Local Time:
    8:34 PM
    1.9.10
    10.1.11
    So, what is the instructions for enable fastcgi cache on xenforo 2.1 forum ? I mean the nginx and php-fpm rules exactly. I confused
     
  4. rdan

    rdan Well-Known Member

    4,939
    1,179
    113
    May 25, 2014
    Ratings:
    +1,785
    Local Time:
    1:34 AM
    Mainline
    10.2
  5. negative

    negative Active Member

    384
    46
    28
    Apr 11, 2015
    Ratings:
    +90
    Local Time:
    8:34 PM
    1.9.10
    10.1.11
    Perfect job (thread) what i want to see Thanks @rdan

    Btw, should we use the litespeed cache add-on even on nginx too ? i confused just for about that

    Or if xenforo 2 including session cookie naturally, why we need an add-on ? We can control the session cookie on nginx rules directly already ?!?
     
  6. rdan

    rdan Well-Known Member

    4,939
    1,179
    113
    May 25, 2014
    Ratings:
    +1,785
    Local Time:
    1:34 AM
    Mainline
    10.2
    Yes, just to have persistent cookie for Login Users.

    XenForo by default don't have persistent cookie.
     
  7. negative

    negative Active Member

    384
    46
    28
    Apr 11, 2015
    Ratings:
    +90
    Local Time:
    8:34 PM
    1.9.10
    10.1.11
    I've applied and i will see the differences.

    However, i worry about that parameter at http headers, is something wrong?


    Ekran Resmi 2020-02-04 02.28.26.png

    Last thing is, if someone found clear a cache of page which modified /post new reply would be perfect as fastcgi cache. Because for now, guest visitors can't show the new posts which posted by members before cache timeout. So in this mean, i've set the cache time as 1hours and the thread cache will stay without updated with new posts so guests will not see the new posts.

    Is there any way for do it ? Actually i will go to custom development for it if possible.
     
  8. rdan

    rdan Well-Known Member

    4,939
    1,179
    113
    May 25, 2014
    Ratings:
    +1,785
    Local Time:
    1:34 AM
    Mainline
    10.2
    Seems correct.

    Maybe but I haven't tried looking at it.
     
  9. negative

    negative Active Member

    384
    46
    28
    Apr 11, 2015
    Ratings:
    +90
    Local Time:
    8:34 PM
    1.9.10
    10.1.11
    Because, if we use an add-on which clear the cached page by fastcgi when new reply(for thread pages), new thread(for forum node pages) so we may even set the cache time like up to 2-3 days. (except homepage)

    server and page load times will be more fresh then
     
  10. negative

    negative Active Member

    384
    46
    28
    Apr 11, 2015
    Ratings:
    +90
    Local Time:
    8:34 PM
    1.9.10
    10.1.11
    keys_zone=fastcgicache:256m

    but /var/run/nginx_fastcgi_cache directory size is 350 mb for now.

    Should i increase the keys_zone parameter value ? @rdan
     
  11. rdan

    rdan Well-Known Member

    4,939
    1,179
    113
    May 25, 2014
    Ratings:
    +1,785
    Local Time:
    1:34 AM
    Mainline
    10.2
  12. negative

    negative Active Member

    384
    46
    28
    Apr 11, 2015
    Ratings:
    +90
    Local Time:
    8:34 PM
    1.9.10
    10.1.11
    @rdan i have a question (so it may bug on this method)

    I have light and dark styles on board. And guest switch between the styles of course.
    Today i see that, some pages caching as dark style

    How can i prevent it ?
     
  13. rdan

    rdan Well-Known Member

    4,939
    1,179
    113
    May 25, 2014
    Ratings:
    +1,785
    Local Time:
    1:34 AM
    Mainline
    10.2
    Add xf_style_id bypass.
     
  14. rdan

    rdan Well-Known Member

    4,939
    1,179
    113
    May 25, 2014
    Ratings:
    +1,785
    Local Time:
    1:34 AM
    Mainline
    10.2
  15. negative

    negative Active Member

    384
    46
    28
    Apr 11, 2015
    Ratings:
    +90
    Local Time:
    8:34 PM
    1.9.10
    10.1.11
    Ok sounds perfect, i applied.

    And for full clear the old caches;

    rm -rf /var/run/nginx_fastcgi_cache

    is correct command and enough ?
     
  16. rdan

    rdan Well-Known Member

    4,939
    1,179
    113
    May 25, 2014
    Ratings:
    +1,785
    Local Time:
    1:34 AM
    Mainline
    10.2
    Nginx restart is enough.
     
  17. negative

    negative Active Member

    384
    46
    28
    Apr 11, 2015
    Ratings:
    +90
    Local Time:
    8:34 PM
    1.9.10
    10.1.11
    I think no because i applied the code changes for style bug and nprestart, and still same page shows as dark style so i thought cached pages didn't cleared.
     
  18. negative

    negative Active Member

    384
    46
    28
    Apr 11, 2015
    Ratings:
    +90
    Local Time:
    8:34 PM
    1.9.10
    10.1.11
    Also, how can i prevent caching of the forum home page ?

    $nocacheuri
    /index.php

    doesn't work.
     
  19. negative

    negative Active Member

    384
    46
    28
    Apr 11, 2015
    Ratings:
    +90
    Local Time:
    8:34 PM
    1.9.10
    10.1.11
    I have problem still even i applied that.
    May be we miss something ?
    Like need prevent the url /misc/style? too ?

    My forum homepage cached with dark style now if i visit as guest, even i can't change the style with style switcher, it shows the dark style always until run the command rm -rf /var/run/nginx_fastcgi_cache so cache clears.
     
  20. rdan

    rdan Well-Known Member

    4,939
    1,179
    113
    May 25, 2014
    Ratings:
    +1,785
    Local Time:
    1:34 AM
    Mainline
    10.2
    Code updated:
    https://xenforo.com/community/resou...x-fastcgi_cache-full-page-guest-caching.7582/