25 days later

I am trying to setup my second site for fastcgi-cache
So I can just use the same directory ?
mkdir /dev/shm/fastcgi-cache
or I need to create new directory for new site ?
mkdir /dev/shm/fastcgi-cache2

and new config site
define('RT_WP_NGINX_HELPER_CACHE_PATH', '/dev/shm/fastcgi-cache2');

????

    lucius100 Caching on local disk is not as fast as putting it in an in-memory database like Redis|MongoDB|Memcached. You can try using

      aapanel_power
      With all due respect, that is not what @lucius100 is asking. I also would like to know the answer to his question.
      Besides that, I don't believe that Redis should be used for full page caching, but Fastcgi.

      Kind greetings,
      Jimmy

        JimmyBobsa I think we can mix the folder for both site, but purge cache sure will clear the cache for 2 sites, that's why we need to create second folder maybe ?

        @aapanel_power I just want to use fastcgi on local disk, no enough memory for redis,etc.

          lucius100 but purge cache sure will clear the cache for 2 sites

          Correct. I have 11 WP sites running on a 4GB VPS and all sites are really fast. But when 1 sites clears the cache, cache is purched for all sites. So 1 dir per website is the best idea indeed. Could not find how to make it work like that.

            JimmyBobsa Try make change to directory in step 1,2,6

            /dev/shm/fastcgi-cache

            make it more memorable, if website is example.com try use folder
            /dev/shm/example

            In theory, it should work.

              lucius100 In theory, it should work.

              Yep, but it doesn't ๐Ÿ˜€
              I have tried different way's, but the cache dir stay's empty. I tried with PHP 7.3/7.4 and 8

                JimmyBobsa I tried it just now, and it doesn't work lol.

                ERROR:
                nginx: [emerg] "fastcgi_cache_key" directive is duplicate in /www/server/panel/vhost/nginx/example.com.conf:1
                nginx: configuration file /www/server/nginx/conf/nginx.conf test failed

                I can't even use same setting for second site, it seems like fastcgi caching only can for 1 website.

                So right now, all your website no caching ?
                I just migrated from OLS to nginx, there's no way I gonna back again T_T
                Really hope there's solution for fastcgi caching 2 or more website

                • Free replied to this.

                  lucius100 For the second site change with /dev/shm/nginx-cache try this.

                  zimmer Have you tried to follow this tutorial?

                  The url you gave, is the page we are on right now. So.. yes. ๐Ÿ˜€

                    5 days later
                    17 days later

                    nginx: [emerg] "fastcgi_cache_key" directive is duplicate in /www/server/panel/vhost/nginx/xyz.xyz.conf:1
                    nginx: configuration file /www/server/nginx/conf/nginx.conf test failed

                    I am getting this error Please fix this as soon as possible

                    2 months later

                    good morning, I followed all the steps of the estalaรงao, the first site worked, but on the second site, I made the same settings, skipped the first step, as suggested above.

                    Now my second site is downloading index.php when I access the site.

                    How can I solve this? already tried several ways.

                    php log error
                    while reading response header from upstream, client: 162.158.90.51, server: mpsicomed.engineteam.com.br, request: "POST /wp-admin/admin-ajax.php?action=wp_1_dokan_pro_sv_update_seller_product_status&nonce=25c1938759 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-74.sock:", host: "mpsicomed.engineteam.com.br", referrer: "https://mpsicomed.e

                      yes,the wordpress plugin is also active on the site, is there anything else I need to do?

                      ![
                      ](https://)

                      a month later

                      I did everytingh and I get no HIT.

                      PROBLEM: when I comment the line "include-php-74.conf" I get an Nginx 502 Bad Gateway on website.

                      I checked all paths and permitions and all seems ok.

                      This is the Headers I get:

                      cache-control: no-store, no-cache, must-revalidate
                      content-encoding: gzip
                      content-type: text/html; charset=UTF-8
                      date: Wed, 15 Dec 2021 11:23:56 GMT
                      expires: Thu, 19 Nov 1981 08:52:00 GMT

                      link: <https://site.com/wp-json/>; rel="https://api.w.org/"
                      link: <https://site.com/wp-json/wp/v2/pages/714>; rel="alternate"; type="application/json"
                      link: <https://site.com/>; rel=shortlink

                      pragma: no-cache
                      server: nginx
                      strict-transport-security: max-age=31536000
                      vary: Accept-Encoding

                      I also got this errors on sitelogs (maybe is not related but i am surprised because wordpress never used such file favicon.ico):

                      [crit] 18975#0: *56 connect() to unix:/tmp/php-cgi-73.sock failed (2: No such file or directory) while connecting to upstream, client: 77.230.69.14, server: site.com, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/tmp/php-cgi-73.sock:", host: "site.com"

                      [crit] 18975#0: *56 connect() to unix:/tmp/php-cgi-73.sock failed (2: No such file or directory) while connecting to upstream, client: 77.230.69.14, server: site.com, request: "GET /favicon.ico HTTP/2.0", upstream: "fastcgi://unix:/tmp/php-cgi-73.sock:", host: "site.com", referrer: "https://site.com/"

                      2021/12/15 12:21:34 [crit] 19126#0: *21 SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking, client: 35.203.251.57, server: 0.0.0.0:443

                      [error] 19084#0: *7 open() "/www/wwwroot/site.com/favicon.ico" failed (2: No such file or directory), client: 77.230.69.14, server: trabajodeporte.com, request: "GET /favicon.ico HTTP/2.0", host: "site.com", referrer: "https://site.com/"

                      Fix please?

                      fast-cgi cache is the important page cache method and aaPanel author even did not give the solution for two or more websites on this thread. Poor aaPanel. I will stop to try aaPanel here.

                      Connect with us: ๐Ÿ“จ Telegram ๐Ÿ’ฌ Discord Email: support@aapanel.com