Tutorial Aktifkan FastCGI Cache WordPress dengan aaPanel. ------------------------------- : Pudin S. : t.me/pudin_ira : instagram.com/pudin.ira : https://www.pdn.my.id : youtube.com/c/pudintv : youtube.com/c/pudintea SUMBER : https://www.pdn.my.id/2022/10/tutorial-aktifkan-fastcgi-cache-wordpress-aapanel.html Buat Folder Cache # mkdir /dev/shm/fastcgi-cache site configuration > Config ---------------------------------------------- fastcgi_cache_key "$scheme$request_method$host$request_uri"; fastcgi_cache_path /dev/shm/fastcgi-cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m; fastcgi_cache_use_stale error timeout invalid_header http_500; fastcgi_ignore_headers Cache-Control Expires Set-Cookie; site configuration > Config Simpan dibawah #SSL-END --------------------------------------------- set $skip_cache 0; if ($request_method = POST) { set $skip_cache 1; } if ($query_string != "") { set $skip_cache 1; } if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml") { set $skip_cache 1; } if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") { set $skip_cache 1; } location ~ [^/]\.php(/|$) { try_files $uri =404; fastcgi_pass unix:/tmp/php-cgi-80.sock; fastcgi_index index.php; include fastcgi.conf; add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; fastcgi_cache_bypass $skip_cache; fastcgi_no_cache $skip_cache; add_header X-Cache "$upstream_cache_status From $host"; fastcgi_cache WORDPRESS; add_header Cache-Control max-age=0; add_header Nginx-Cache "$upstream_cache_status"; add_header Last-Modified $date_gmt; add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; etag on; fastcgi_cache_valid 200 301 302 1d; } location ~ /purge(/.*) { allow 127.0.0.1; allow "change_to_your_server_ip"; deny all; fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1"; } NOTE : Sesuaikan 1. fastcgi_pass unix:/tmp/php-cgi-80.sock; 2. allow "change_to_your_server_ip"; Tambahkan di wp-config.php ------------------------------------------------ define('RT_WP_NGINX_HELPER_CACHE_PATH', '/dev/shm/fastcgi-cache'); ------------- END -------------------------- SUMBER : https://www.pdn.my.id/2022/10/tutorial-aktifkan-fastcgi-cache-wordpress-aapanel.html