Learn about Centmin Mod LEMP Stack today
Become a Member

Xenforo Fastcgi cache configuration for Xenforo?

Discussion in 'Forum software usage' started by Everlind, Jun 17, 2014.

  1. rdan

    rdan Well-Known Member

    5,003
    1,201
    113
    May 25, 2014
    Ratings:
    +1,827
    Local Time:
    6:02 AM
    Mainline
    10.2
    He didn't implemented it here :(
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,631
    10,356
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,070
    Local Time:
    8:02 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Yeah not running fastcgi_cache on this forum :)
     
  3. hungphutho

    hungphutho Member

    55
    35
    18
    Jun 2, 2014
    Ratings:
    +35
    Local Time:
    5:02 AM
    1.7.2
    Percona 5.6
    add xf_style_id=xx|xf_style_id=xx
    Code:
    # Don't use the cache for logged in users and Don't use the cache for guest change style
        if ($http_cookie ~* "xf_session_admin|xf_user|xf_user_admin|xf_style_id=xx|xf_style_id=xx") {
            set $no_cache 1;
        }
     
  4. rdan

    rdan Well-Known Member

    5,003
    1,201
    113
    May 25, 2014
    Ratings:
    +1,827
    Local Time:
    6:02 AM
    Mainline
    10.2
    I don't really know what Floren mean here :(
    Nginx Fastcgi_cache configuration for Xenforo Board | XenForo Community
     
  5. rdan

    rdan Well-Known Member

    5,003
    1,201
    113
    May 25, 2014
    Ratings:
    +1,827
    Local Time:
    6:02 AM
    Mainline
    10.2
    @hungphutho
    I have this problem now:
    What is your solution for this issue?
     
  6. Floren

    Floren Active Member

    148
    77
    28
    Jun 6, 2014
    Ratings:
    +77
    Local Time:
    5:02 PM
    @RoldanLT has a tendency to ask things on 200 forums, except AXIVO. :D
    I told him exactly what to do, but instead of following my advice, he posts things all over the places "hoping" it will work.
     
  7. hungphutho

    hungphutho Member

    55
    35
    18
    Jun 2, 2014
    Ratings:
    +35
    Local Time:
    5:02 AM
    1.7.2
    Percona 5.6
  8. rdan

    rdan Well-Known Member

    5,003
    1,201
    113
    May 25, 2014
    Ratings:
    +1,827
    Local Time:
    6:02 AM
    Mainline
    10.2
  9. pamamolf

    pamamolf Premium Member Premium Member

    3,883
    381
    83
    May 31, 2014
    Ratings:
    +741
    Local Time:
    12:02 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Is it possible to use fast cgi cache path to a tmpfs partition without doing the trick for guests ?

    And it will really help or it is only for the trick with the guests?
     
  10. eva2000

    eva2000 Administrator Staff Member

    45,631
    10,356
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,070
    Local Time:
    8:02 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    what do you mean tricks for guests ? fastcgi_cache is predominantly only used for caching for guests never logged in users - same goes for wordpress and fastcgi_cache - guests only
     
  11. pamamolf

    pamamolf Premium Member Premium Member

    3,883
    381
    83
    May 31, 2014
    Ratings:
    +741
    Local Time:
    12:02 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    It works only if you do the cookie trick for guests or it works in general for guests without any cookie settings?
     
  12. eva2000

    eva2000 Administrator Staff Member

    45,631
    10,356
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,070
    Local Time:
    8:02 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Every web/php app will need some form of cookie manipulation and/or understanding of that web/php app's cookie/session functionality to properly implement fastcgi_cache for nginx/php-fpm. It's one reason I can implememt fastcgi_cache for wordpress and just a bit off and not able to for xenforo as I know wordpress well and xenforo not as well. Hence, why fastcgi_cache is left to end users to do as it requires an understanding of the web/php app itself to properly implement. It's same for Varnish Cache too, understanding the web/php app is important - especially for how the web/php app deals and uses cookies/sessions for guests and non-guests.
     
  13. nfn

    nfn New Member

    29
    0
    1
    Jun 28, 2015
    Ratings:
    +8
    Local Time:
    10:02 PM
    Hi,

    I just register here today.
    I came from IPB, just mover last weekend to XF and I'm loving this :)

    in IPB I use this same technic to cache pages for guest, but with xf I don't see xf_user or xf_user_admin in my headers,
    Do theses cookies still exists in XF1.4?

    I only see xf_session_admin and xf_session

    Thanks
     
  14. rdan

    rdan Well-Known Member

    5,003
    1,201
    113
    May 25, 2014
    Ratings:
    +1,827
    Local Time:
    6:02 AM
    Mainline
    10.2
    Stay logged in, must be checked always and hidden so that xf_user cookies will be available.
     
  15. rdan

    rdan Well-Known Member

    5,003
    1,201
    113
    May 25, 2014
    Ratings:
    +1,827
    Local Time:
    6:02 AM
    Mainline
    10.2
  16. rdan

    rdan Well-Known Member

    5,003
    1,201
    113
    May 25, 2014
    Ratings:
    +1,827
    Local Time:
    6:02 AM
    Mainline
    10.2
  17. eva2000

    eva2000 Administrator Staff Member

    45,631
    10,356
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,070
    Local Time:
    8:02 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
  18. negative

    negative Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    12:02 AM
    1.9.10
    10.1.11
    @rdan @eva2000

    How can we exclude the forum homepage or set different cache time ?
    Thanks
     
  19. eva2000

    eva2000 Administrator Staff Member

    45,631
    10,356
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,070
    Local Time:
    8:02 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    If you're not familar with fastcgi_cache, I would use a different caching method as fastcgi_cache is left to end user to customise. Though excluding home page location context / is difficult as is due to location match.

    As to changing time it's in fastcgi_cache_valid Module ngx_http_fastcgi_module
     
  20. negative

    negative Active Member

    415
    50
    28
    Apr 11, 2015
    Ratings:
    +98
    Local Time:
    12:02 AM
    1.9.10
    10.1.11
    One way is exclude the homepage i though but i didn't

    Actually, my forum installed on /forum/ directory and i've tried the exclude /forum/, /forum or like /forum/index.php but it didn't, it exludes all forum and sub pages.

    What are u using on that forum @eva2000 ? Only nginx pagespeed or what?