Troubleshooting Cache Settings

Are you experiencing form submission issues when using site caching? Problems with form submission often result from a conflict between the cached site and the anti-spam protection feature in WPForms.

This guide will show you how to optimize your site’s cache settings to fix form submission issues.

Understanding Site Caching

WordPress sites run on a programming language called PHP. A web server interprets and runs this code, producing what you see on screen.

The server periodically saves copies of your site’s pages when caching is enabled. Caching optimizes overall performance, and conserves system resources.

The server must regularly refresh the site cache to keep up with changes to the website.

Managing Site Caching

There are many approaches, and multiple solutions, to site caching, including various WordPress plugins.

We won’t cover them here, but we encourage you to check out this article on WPBeginner, which covers some of the best plugins for the job. If you would like to know how to clear your site cache, we recommend following this guide to clearing site cache in WordPress on WPBeginner.

Why Caching Causes Submission Issues

The anti-spam feature in WPForms uses a regularly updated token to keep your site protected. When the site cache lifetime is too high, it causes a mismatch between the token referenced, and the token used on the page.

Form submission errors can occur when this mismatch causes the WPForms anti-spam feature to be activated. The server must update the site cache at shorter intervals to avoid this problem.

If your site’s cache lifetime is higher than that of the form token WPForms generates, users may encounter the error “The form was unable to submit. Please contact the site administrator.” when submitting your form.

Form unable to submit

Note: There can be other causes of form submission errors. To be certain if site caching is causing submission errors, we recommend clearing your site’s cache before testing your form.

For further information, please check out the WPForms troubleshooting guide.

We recommend decreasing the site cache lifetime to optimize performance while preserving security. This solution is safer and more effective than increasing the lifetime of the form token.

Please see our tutorial for more details on resolving form not submitting issues in WPForms.

Note: If you still need to change the cache lifetime of the WPForms form token, check out this article in the WPForms developer docs. Please note that this requires editing your website’s code, and is recommended for developers.

Optimizing Site Cache Lifetime

Since there are multiple solutions to managing site caching, we will not list specific directions here. Setting a site cache lifetime of around 45 hours should be sufficient to avoid submission errors.

We recommend that you follow the documentation for your solution of choice.

You now know how to optimize your site cache settings to prevent form submission errors in WPForms!

Next, would you like to receive notifications when a form is submitted? Check out this article to learn how to set up form notifications in WPForms.