-
AuthorPosts
-
November 4, 2022 at 7:55 pm #1371371
Good evening,
For some time now, contact forms have not worked properly with WP-Rocket.
Bug : Contact form doesn’t work any more.The bug affects on all other contact form of the site.
However the bug doesn’t appear immediatly.
The bug appears after several hours when caching is enable.
When purging the cache, the problem is fixed but remains again after time (even if I reduce the delay between automatic cache period below than 10 or 7 hours).Here is an explanation.
_________________
Hi,
Nice to meet you :)
Thanks for the details.
From what you mention, this could be related to the form’s hidden values (screenshot in private).
If you are using the hidden inputs to have different values in different situations, unfortunately this won’t work because the values are printed directly in the HTML, and as you know the HTML is cached.
This is how this works:
Cache is cleared
A user visits a page (or if you have the preload function enabled, then the visit will be done by it to pre-cache the page)
The PHP code is executed, and the values are created for the hidden inputs
WP Rocket captures the resultant HTML and saves it for future visits
A new user visits the same page, the saved / cached HTML is served to the new user, so the values in the hidden inputs will be the same as the previous visit, because the page is cached, and the same will happen for all the visits you have to that page, the same cache will be served for all of them until the cache is cleared, and the process is repeated.Here, the data will be very inconsistent, all the users will use the exact same values.
As you see, the way you are using to manage this, is not compatible with cache.In this case, you have two options:
You can ask your developers to use a different approach, compatible with caching, it could be cookie based for example: Create Different Cache Files with Dynamic and Mandatory Cookies
You can disable page caching while keeping the optimizations, WP Rocket will still optimize your website, but the cache won’t be created: Disable Page Caching
I hope this information is useful for you 😃______________
So can you make a fix in future version for this. Please?
Best regards.
November 11, 2022 at 4:07 pm #1372226Hey,
Thanks for your patience!
Our devs have reviewed your thread and informed us that the mentioned changes would mean rewriting contact form logic from scratch which requires a lot of work and considered risky therefore our recommendation is disabling the cache on the page containing contact form element. We are going to add a notice in upcoming version to inform our users.
Best regards,
YigitNovember 11, 2022 at 7:04 pm #1372254Hi,
For the moment, cache is disabled since several days for these pages.
Thks for your answer.
I feared aboout this delicate point but since several versions on WP-Rocket, it seems that Enfold and this plugin not compatible any more.
Best regards. -
AuthorPosts
- The topic ‘Enfold contact form and WP-Rocket !’ is closed to new replies.