FastCGI Cache Setup Kaise Kare – Complete Guide in Hindi

Agar aap apni WordPress site ki performance improve karna chahate hai to aap Nginx FastCGI Cache enable kar apni site ko speed up kar sakte ho. Is post me main WordPress Ke Liye Nginx Ubuntu 18.04 Server Par FastCGI Cache Setup Kaise Kare? ke bare me explained tutorial share kar raha hu. To chaliye jante hai How to Setup FastCGI Cache in Nginx on Ubuntu Server for WordPress Blog – Beginner Guide in Hindi 2024.

WordPress Nginx FastCGI Cache

Waise WordPress site ki speed improve karne ke liye aap WP Super Cache, W3 Total Cache plugins ka istemal kar sakte ho lekin page caching ke liye FastCGI Cache plugin se jyada best hai.

Nginx FastCGI Cache WordPress Cache plugin se lagbhag 60% jyada fast hai aur 1.5 guna jyada request per second handle kar sakta hai. Main apni sites par isi ka istemal karta hu.

For example, aap ye compare tutorial me dekh sakte hai ki FastCGI and Cache Plugin me se kya best hai aur konsa site ko jyada speed up karta hai.

Chaliye ab main aapko Nginx server par FastCGI Cache enable karne ka aasan tarika bata hu,

How to Enable FastCGI Cache in Nginx for WordPress in Hindi

Iske liye aapke pas Ubuntu Server par with Nginx WordPress run hona chahiye, agar aapne abhi tak tak nahi kiya hai to aap humare is tutorial ko follow karke Nginx par WordPress install kar sakte hai.

Uske baad aapko niche di gayi step by step guideline ko follow karke FastCGI Cache install activate kar sakte ho.

Step 1: Open Nginx Configure File

FastCGI Cache enable karne ke liye aapko Nginx configuration file me code add kana hoga. Iske liye aap PUTTY se via FTP apna server access kare aur is command se Nginx configure file open kare.

$sudo nano /etc/nginx/sites-available/default

Step 2: Configure FastCGI in Nginx Block

Ab main yaha apna full nginx configure file code add kar raha hu aur FastCGI code ko red color se highlight kar raha hu, aapko isi tarah se apne nginx block me setup karna hai.

fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=MYAPP:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
add_header X-Cache $upstream_cache_status;
server {
listen 80 default_server;
root /var/www/html;
index index.php index.html index.htm;
server_name supportmeindia.com;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
include fastcgi_params;
fastcgi_cache MYAPP;
fastcgi_cache_bypass $no_cache;
fastcgi_no_cache $no_cache;
fastcgi_cache_valid 200 60m;
}
location ~ /\.ht {
deny all;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
log_not_found off;
access_log off;
allow all;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|eot|otf|ttf|woff)$ {
expires max;
log_not_found off;
}
set $no_cache 0;
if ($request_method = POST) {
set $no_cache 1;
}
if ($query_string != "") {
set $no_cache 1;
}
if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|post-sitemap.*.xml|sitemap(_index)?.xml") {
set $no_cache 1;
}
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
set $no_cache 1;
}
}

Sahi se configuration karne ke baad Ctrl+X press kar YES select kare aur file ko save kar le.

Step 3: Check Configuration and Restart Nginx Server

Ab is command se configuration test check kar nginx server ko restart kare.

$sudo nginx -t
$sudo systemctl reload nginx

Conratulations! aapne successfully nginx server par FastCGI cache enable kar liya hai, lekin ruko abhi hume ye check karna hai ki ye work kar raha hai ya nahi.

Step 4: Check FastCGI Work or Not

Ab aapko ye check karna hai ki, aapke blog par fastcgi cache work kar raha hai ya nahi, iske liye apne blog ko internet browser me open kare aur uska header section check kare, aapko is tarah se  ka option dikhayi dega.

  • X-Cache: HIT

Agar Hit header dikhayi de to iska matlab hai, aapke blog par FastCGI properly work kar raha hai. Aap Pingdom, GtMetrix jaise speed test tool pa site header code check kar sakte hai.

Step 5: Purging FastCGI Cache

Agar aapko kabi FastCGI cache delete karni hai to aap apne server par PUTTY se login kar niche di gayi command line se cache clear kar sakte hai.

$sudo rm -r /etc/nginx/cache/*

Is tarah se aap easily apni WordPress website ke liye Nginx server par FastCGI Cache enable kar sakte hai.

Agar aapko ye information pasand aaye to ise dusre blogger ke sath share jarur kare taki wo bhi iska istemal kar sake.

Avatar for Jumedeen Khan

About Jumedeen Khan

I'm the founder of this site and we regularly share useful and helpful information here for beginners. ❤️

Reader Interactions

Comments (19)

  1. Avatar for aakibaakib

    Hi Jumedeen Sir, Mian ye janna chahte hu ki aakhir Nginx ke sath aur kaun se cache systems use kiya ja sakta hai. Jo site ko aur fast bana de. lekin FAst CGI ke alawa jo cache isme successfully work karte hain bas uski list bata de aap.

    • Avatar for जुमेदीन खानजुमेदीन खान

      Opcache, Redis cache, Memcache cache, Varnish cache लेकिन FastCGI cache बेस्ट है

  2. Avatar for kashifkashif

    mera ubuntu 16.04 verion hai isko kaise update karu

    • Avatar for जुमेदीन खानजुमेदीन खान

      बेहतर होगा आप नया सरवर setup कर ले

  3. Avatar for Rohan KohliRohan Kohli

    FastCGI very great option to make website super fast. But ek question hain agar me FastCGI ke sath cache plugin use karu to koi issue hoga?

    • Avatar for Jumedeen khanJumedeen khan

      Yes hoga, both cache use karne par site down problem ho sakti hai.

  4. Avatar for Sarthak upadhyaySarthak upadhyay

    Thanku so much, mai sarthak aksar aapke blog ko padhta hu aur fast-cgi cache ka digital ocean vala tutorial kaafi confusing hai. Aapne ise saral banake bataya bahut accha lg rha hai.

    Thanks …

    Ek aur question hai ,kya ise enable karne ke baad dusri cache plugin use karna chahiye..

    • Avatar for Jumedeen khanJumedeen khan

      Nahi, fastcgi ke sath cache plugin ki koi jarurat nahi hai.

  5. Avatar for shakilshakil

    Sir yahan ek chiz samajh me nahi aayi ki caching check kaise kare. Aaapne batatya ki header me wo word dekhna hai but kaise please screenshot bhi add kar den.

    • Avatar for Jumedeen khanJumedeen khan

      Gtmetrix par site speed check karo aur process complete hone ke baad waterfall par click kar apne domain par click karo, ab responsive header me check karo cache hit ka option mil jayega.

  6. Avatar for Rushikesh SonawaneRushikesh Sonawane

    Nice and very useful article

    • Avatar for Rushikesh SonawaneRushikesh Sonawane

      Bro par aapne FastCGI ko RAM se serve karne ke process ke bare me nahi bataya.

      • Avatar for Jumedeen khanJumedeen khan

        mere hisab se ye best hai, aap chaho to cache path change kar sakte ho. bas iske liye aapko ek folder banana padega.

  7. Avatar for Vikash GuptaVikash Gupta

    aapki har post se kuch nayaa sikhne ko miltaa hai , aapke rahte aisaa lagtaa hai blogging karne me koi pareshani nahi hogi . thanks bhaiya

    • Avatar for Jumedeen khanJumedeen khan

      Its my pleasure mere dost.

  8. Avatar for Aakib javedAakib javed

    Amazing tutorial jdk sir. Hatss off to you sir. Itni jaldi post taiyaar karne ke liye. Bahut bahut thanks aur dil se dher saari dua aapke liye. Aap aur aage badho aur har khawahish puri ho aapki. Is post se mujhe bahut help mili .

    • Avatar for Jumedeen khanJumedeen khan

      Your most welcome.

  9. Avatar for Mayur chanpaMayur chanpa

    HELLO SIR

    1:- Google ke Search Console me Excluded
    by ‘noindex’ tag kar ke error show ho rahi
    he….

    2:- Or mere post me kuch link ke piche /feed/
    aa raha he jinke wajh se mera post Search
    engine me index nahi ho raha he kyu ki
    mene robot.txt me /feed/ ko disallow kar
    rakha he………lekin me yah nahi samaj
    paa raha hu ke mere aadhe blog post ke
    piche /feed/ kyu show ho raha he

    3:- Or aap mujhe bata sakte he ke blog post
    ke piche /feed/ link ko kaise remove kare
    taaki mera post search engine me index
    ho jaye….

    please is comment ka answer dijiye….

    • Avatar for Jumedeen khanJumedeen khan

      Feed url ko inde karne ki jarurat nahi hai, sabke me hota hai, aapke url bina feed ke bhi work kar rahe hai, google ko use index karna chahiye, remove karne ki jarurat nahi hai ye post feed url hai.

Add a Comment

Your email address will not be published. Required fields are marked *

I need help with ...