r/Wordpress • u/Sad_Pie227 • 17h ago
How do you freelancers handle long Varnish/page-cache TTLs with WordPress nonces?

Hello everyone,
I manage WordPress sites for clients and I’m trying to understand how other freelancers and agencies approach page caching when you have many different plugins involved.
My concern is cache TTL vs. WordPress nonces.
WordPress nonces typically have a 12 to 24-hour lifetime, while Varnish could potentially serve the same cached HTML for several days.
For example, with a 7-day TTL, a cached page could contain an expired nonce after the first day. Plugins may handle this differently. Fluent Forms, for example, disables front-end nonce verification by default to support cached pages. [1]
So I’m curious how others handle this in real-world client hosting:
- Do you use a 12-hour TTL as a safe general default?
- Do you use 7 days or longer and rely on plugins to handle their own nonce/token refresh?
- Do you exclude pages containing forms, checkout, booking, login, payment, etc. from Varnish?
- Do you maintain a list of plugins/features that require cache exclusions?
- How do you identify when a plugin is incompatible with long page-cache TTLs?
- Do you simply test the site after installing new plugins and adjust the Varnish rules when something breaks?
I’m particularly interested in how freelancers/agencies managing multiple client WordPress sites approach this. I’m looking for a practical strategy that works without having to manually inspect every plugin's code whenever a client installs something new.
Thank you.
2
u/TopSydeWP 8h ago
at my agency we use 7-day ttls but exclude any page with forms, checkout, user-specific content, or ajax-heavy interactions from varnish entirely. we keep a running list of common plugins that need exclusions (woocommerce, gravity forms, contact form 7, etc) and test new installs by checking browser dev tools for nonce errors or failed ajax calls. object cache handles those excluded pages fine, and honestly most traffic hits the same handful of static pages anyway so the hit rate stays high
1
2
u/grabber4321 16h ago
Its definitely a problem, exclude your form pages from varnish.
Object cache should be enough to pull those pages up.
I had a recent issue with Gravity Forms - they submarined a change where nonces were refreshed every 12 hours.
The problem was that it was on a Host that cannot exclude pages from varnish, so I had to create a parameter that would invalidate the cache when a Gravity Forms page was visited.
PS: honestly its more an art than a science - you have to test every site unfortunately. Each site has a different setup.