4.2 KiB
🚨 FIX CACHE ISSUE NOW - Quick Steps
Your Issue: Login screen not showing latest changes
⚡ QUICK FIX (5 minutes)
Step 1: Copy New Files to Server
From your dev machine:
# Commit the new changes
git add .
git commit -m "Add cache-busting and remove demo credentials"
git push origin prodnew
Step 2: Deploy on Production Server
SSH into your server and run:
ssh luckychit@192.168.8.148
cd /home/luckychit/apps/chitfund
git pull origin prodnew
chmod +x force-cache-bust.sh clear-cache-and-deploy.sh
./force-cache-bust.sh
Step 3: Clear Browser Cache
In your browser, do a HARD REFRESH:
- Windows:
Ctrl + Shift + R - Mac:
Cmd + Shift + R
Or test in Incognito/Private mode (no cache):
- Windows:
Ctrl + Shift + N - Mac:
Cmd + Shift + N
✅ What This Does
- Pulls latest code (with cache-busting fixes)
- Stops PM2 frontend (clears server cache)
- Deletes old build (removes cached files)
- Builds with timestamp (forces browser to reload)
- Restarts PM2 (serves fresh files)
🎯 Expected Result
After running the script and hard refresh, you should see:
- ✅ Login screen without demo credentials box
- ✅ Clean professional login interface
- ✅ Updated design
🔍 If Still Not Working
Option 1: Clear Browser Cache Completely
Chrome:
- Three dots menu → Settings
- Privacy and security → Clear browsing data
- Select "Cached images and files"
- Time range: "All time"
- Click "Clear data"
Firefox:
- Menu → Settings → Privacy & Security
- Cookies and Site Data → Clear Data
- Check "Cached Web Content"
- Click "Clear"
Option 2: Test in Different Browser
Open the site in a browser you haven't used before - it will have no cache.
Option 3: Check Service Worker
- Press
F12to open DevTools - Go to "Application" tab (Chrome) or "Storage" tab (Firefox)
- Find "Service Workers"
- Click "Unregister" for all service workers
- Refresh the page
📱 Mobile Users
If testing on mobile:
Android Chrome:
- Menu → Settings → Privacy → Clear browsing data → Cached images
iOS Safari:
- Settings → Safari → Clear History and Website Data
Or just use Private/Incognito mode for testing
🎓 What I Fixed
1. Added Cache Control Headers
luckychit/web/index.html now has:
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
2. Updated All Deployment Scripts
deploy-full.sh- Now includes cache-bustingdeploy-frontend-only.sh- Now includes cache-busting
3. Created New Cache-Busting Scripts
force-cache-bust.sh- Nuclear option (use now!)clear-cache-and-deploy.sh- Thorough cache clearing
4. Builds with Timestamps
Every build now gets unique version number to break cache
🚀 Future Deployments
From now on, just use:
./deploy-frontend-only.sh
It now automatically handles cache-busting! 🎉
If cache is stubborn:
./force-cache-bust.sh
📊 Verify It Worked
After deployment:
-
Check PM2:
pm2 status # Should show "online" for both services -
Check Logs:
pm2 logs luckychit-frontend --lines 10 # Should show recent activity -
Test in Browser:
- Open in Incognito:
Ctrl + Shift + N(Windows) orCmd + Shift + N(Mac) - Go to:
http://192.168.8.148:8080 - Login screen should NOT show demo credentials
- Open in Incognito:
-
Check Build Time:
cd /home/luckychit/apps/chitfund/luckychit/build/web ls -lh # Timestamps should be very recent
📞 Still Issues?
If you still see old version after all this:
- Take a screenshot of what you see
- Check PM2 logs:
pm2 logs luckychit-frontend - Check build directory modification time
- Try a different device/computer
🎉 Summary
Run these 3 commands:
ssh luckychit@192.168.8.148
cd /home/luckychit/apps/chitfund
./force-cache-bust.sh
Then in browser:
Ctrl + Shift + R (Windows) or Cmd + Shift + R (Mac)
That's it! Your login screen will show the latest version without demo credentials. 🚀