Nonces and Cache Lifespan

Nonces are security tokens in WordPress. They get printed into the HTML source code. 

Nonces can only be used once (hence “n once”), and they are only valid for a certain length of time: 12 hours by default, but developers can change that value.

On a cached page, the nonce can expire in the background while its ID is still present in the HTML source code of the page. If that happens, the HTML source is referencing an invalid nonce and things break.

This can affect all kinds of functionality, from form validation to the visual appearance of a post grid, and a lot more. In some rare cases it could even lead to a completely blank page on the front-end.

Set cache lifespan to 10 hours or less

After the cache gets cleared, the HTML gets regenerated and references a correct nonce again. Hence, when your WordPress setup (theme, plugins) operates with nonces, the only way to keep them updated on cached pages is to set your Cache lifespan option in WP Rocket to a value below 12 hours; 10 hours would be a starting point, but you may have go down to 8 or even less.

This will result in more frequent cache update activity on your server, and thus more preload processes if preload is activated. In case you notice any issues due to high server load, disable bot preload and set a higher interval for sitemap preload.

Further reading: Josh Pollock published a more in-depth post on nonces and caching.