![]() |
|
Guide CloudPanel Varnish Cache Showing Old Pages or Breaking Logins: How to Fix - Printable Version +- AdminsForum (https://adminsforum.com) +-- Forum: Free & open-source control panels (https://adminsforum.com/Forum-free-open-source-control-panels) +--- Forum: CloudPanel (https://adminsforum.com/Forum-cloudpanel) +---- Forum: CloudPanel Guides & Tutorials (https://adminsforum.com/Forum-cloudpanel-guides-tutorials) +----- Forum: CloudPanel Varnish Cache & Performance Guides (https://adminsforum.com/Forum-cloudpanel-varnish-cache-performance-guides) +----- Thread: Guide CloudPanel Varnish Cache Showing Old Pages or Breaking Logins: How to Fix (/Thread-guide-cloudpanel-varnish-cache-showing-old-pages-or-breaking-logins-how-to-fix) |
CloudPanel Varnish Cache Showing Old Pages or Breaking Logins: How to Fix - JAY - 10-23-2026 CloudPanel Varnish cache showing old pages or breaking logins: how to fix Varnish makes CloudPanel sites very fast by keeping a ready-made copy of each page in memory. The downside: when it caches the wrong thing, you see old content, or logged-in pages (account, cart, checkout) behave strangely. This guide shows how to check what Varnish is doing and how to fix the usual problems. For the basics, see CloudPanel cron jobs, logs and Varnish cache. Step 1: Is Varnish serving this page? Look at the response headers: Code: curl -sI https://example.com/ | grep -iE 'x-cache|age|cache-control|via|set-cookie'
Problem 1: changes don't show up You edited a page, but visitors still see the old version.
Problem 2: logins, carts or forms break Symptoms: you log in and get logged out, a customer sees someone else's cart, a form says "expired" or "invalid token". This means a personal page was cached and served to the wrong person. Never let personal pages into the cache. In the site's Varnish Cache > Settings, add the paths that must never be cached to Excludes. Examples for common apps: Code: ^/wp-admin/
wp-login.php
^/my-account/
^/cart/
^/checkout/Pages with special query parameters can be excluded through Excluded Params too (for example a parameter your app adds for logged-in previews). Problem 3: nothing gets cached at all Usually the app sends cookies or Code: Cache-Control: no-cache / private
Problem 4: site broken after turning Varnish on Turn Varnish off for the site first to confirm it's the cause. If the site works without it, turn it on again and add excludes for the broken parts step by step. If you see 502/503 errors instead, see Fix 502 Bad Gateway in CloudPanel. Is Varnish worth it for my site? Varnish helps most on sites with many anonymous visitors and pages that rarely change: blogs, magazines, brochure sites. For a busy shop or members site where most visitors are logged in, its benefit is smaller and the excludes list gets long. Sources: CloudPanel: Varnish Cache settings ยท Varnish documentation More CloudPanel troubleshooting
Applies to CloudPanel v2 on Ubuntu and Debian, October 2026. Replace Code: example.com |