Nginx + Fastcgi Cache - Purge Wordpress

87 views Asked by At

We use VPS with Debian, Nginx 1.24 + PHP-FPM 8.3 with active Fastcgi cache. Everything works ok, but if we want to purge cache from Wordpress, it removes only cache file, not folders. We use Nginx Helper in Wordpress . With previous (and unsupported) plugin Nginx Cache we dont have problem - remove cache with folders.

The plugin requires ngx_cache_purge module, but is not supported in the version 1.24, but purging the cache works.It is possible that version 1.24 already has a similar function integrated.

Has anyone encountered with this problem?

Vhost conf file:

fastcgi_cache_path /var/cache/nginx-cache/brainya levels=1:2 keys_zone=brainya:50m inactive=10m;

location ~ \.php$ {
          fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
        include snippets/fastcgi-php.conf;
        fastcgi_cache brainya;
        fastcgi_cache_valid 200 301 302 2h;
        fastcgi_cache_use_stale error timeout updating invalid_header http_500 http_503;
        fastcgi_cache_min_uses 1;
        fastcgi_cache_lock on;
        fastcgi_cache_bypass $no_cache;
        fastcgi_no_cache $no_cache;
        add_header X-FastCGI-Cache $upstream_cache_status;

Nginx Helper setting Folders

We tried Nginx version 1.22, change fastcgi setting, rights to folders and files

0

There are 0 answers