How to automatically clear cache every 10 hours?




Wordpress LScache Plugin: How to automatically clear cache every 10 hours?

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hey I decided to create a new thread as the one I created earlier began to be fairly long. I thought the issue was taken care of but I am told by the customer that some of her clients are having a difficult time submitting the form. They are getting the Error: Submission rejected, token invalid https://calderaforms.com/doc/caldera-forms-submission-rejected-token-invalid-mean/ This happens because the validation token ? a WordPress nonce ? could not be verified. This happens mainly because a caching plugin such as W3 Total Cache (W3TC) or CDN, such as Cloudflare is in use and caches the pages for longer than the WordPress nonce life ? by default 12 hours. So this means I need to To fix this issue, set a cache exclusion for the page with your form or set a cache life of less than 12 hours Since this is a problem with most forms, including comment forms, we recommend you set your cache to be cleared every 10 hours: How to I automatically clear the cache every 10 hours through the LiteSpeed plugin? Btw the various issues I have posted as well as others post you should really just add into a documentation section so that when someone asks you could give a link to a page in the documentation section. The documentation should also be visible in the search engines so that users can search for this and find the docs available. As I joined the LiteSpeed Slack group to discuss the matter I received these solutions from Lisa the awesome support person at LiteSpeed: The absolute simplest option is to set your sites default TTL to 10 hours. TO do that, go to Settings > General and set Default Public Cache TTL to 36000. The second-simplest option is to set the form page so that it is never cached. To do that, go to Settings > Excludes and add the path to the form to the Do Not Cache URIs box. ? I went with solution 1. Adjusted and then contacted my client and asked them to retest the form. This time it worked nicely with Caldera Forms. Glad I could help I should mention, though, that while those two solutions do solve the problem, sometimes you dont want to have to keep your TTL so short, or exclude your forms from the cache. In those cases, youll want to try ESI. Heres more information about what ESI is. In a nutshell, though, its a way of punching a hole in a publicly-cached page, and treating the contents of that hole differently. So, with ESI, you could keep your site at a longer TTL, but cache the form itself for a much shorter period of time. ESI is a little more complicated to set up, though, and requires time to play and test, so the first two solutions are great if you want a quick fix, or if you have no problem with a 10 hour TTL. Thank you Paal & Lisa So, I think both LS Cache & Caldera has upgraded a lot since this post >> https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:esi_replace As all the implementations are auto the moment you activate ESI I think this method is better than lower Public Cache TTL and/or excluding the entire page. Hi, Rajendra I stand corrected. I didnt realize that Caldera Forms had implemented an ESI integration thats ready to go without further configuration! In that case, turning on ESI is just as simple as adjusting TTL or excluding the page. And its technically a better solution, as we mentioned earlier. Thanks for sharing the extra information.



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference