Home Page Form Doesn’t Work with Cache
-
Hi,
I switched a couple of sites, including my own, to Cache Enabler. I use A2 Hosting with Litepeed (Turbo page cache disabled). Cache Enabler is the simplest, fastest page cache out of everything I tested, so I’d like to use it, however, I’m having one problem…
I have the contact form on my own site in the footer, so it’s on every page. When I have Cache Enabler activated, the form doesn’t submit on the home page. When the form submits, the page reloads with a string added to prevent re-submission if the page is refreshed afterword. I think this is where the problem is.
(I’m using the advanced .htaccess code. It makes no difference whether I use it or not.)
This is the code in the form that handles the reload…
if ( wp_mail( $to, $emailsubject, $body, $headers ) ) { header ("Location: $reload?success=true#footer"); exit; }
This adds /?success=true#footer to the url.
The only time it ever fails is on the home page with Cache Enabler activated.
The page just reloads without the string.
Cache Enabler seems to be caching the string only on the home page…
- I submit the form with Cache Enabler deactivated.
- View page source at view-source:https://oldtownweb.com/?success=true#footer.
- Reactivate Cache Enabler
- Refresh home page.
- Refresh view-source:https://oldtownweb.com/?success=true#footer.
view-source:https://oldtownweb.com/?success=true#footer shows Cache Enabler comment at bottom.
If I repeat the same process on another page, no comment in source.
Is this something I can fix in Cache Enabler settings?
I’m also getting errors when activating/deactivating Cache Enabler on all sites, not just this one. Not sure if it’s related.
In wp-admin upon deactivation…
Warning: include(/home/oldtownw/public_html/wp-content/advanced-cache.php): failed to open stream: No such file or directory in /home/oldtownw/public_html/wp-settings.php on line 84
In error log…
2019-10-26 09:25:39.061870 [NOTICE] [70.15.17.105:60604:HTTP2-1] [STDERR] PHP Warning: Invalid argument supplied for foreach() in /home/oldtownw/public_html/wp-admin/includes/plugin.php on line 1498
2019-10-26 09:25:39.061789 [NOTICE] [70.15.17.105:60604:HTTP2-1] [STDERR] PHP Warning: Invalid argument supplied for foreach() in /home/oldtownw/public_html/wp-admin/includes/plugin.php on line 1498
2019-10-26 09:24:37.540497 [NOTICE] [70.15.17.105:60548:HTTP2-5] [STDERR] PHP Warning: include(/home/oldtownw/public_html/wp-content/advanced-cache.php): failed to open stream: No such file or directory in /home/oldtownw/public_html/wp-settings.php on line 84
2019-10-26 09:24:31.662232 [NOTICE] [70.15.17.105:60548:HTTP2-1] [STDERR] PHP Warning: Invalid argument supplied for foreach() in /home/oldtownw/public_html/wp-admin/includes/plugin.php on line 1498
2019-10-26 09:24:31.662166 [NOTICE] [70.15.17.105:60548:HTTP2-1] [STDERR] PHP Warning: Invalid argument supplied for foreach() in /home/oldtownw/public_html/wp-admin/includes/plugin.php on line 1498
2019-10-26 09:23:23.038471 [NOTICE] [70.15.17.105:60492:HTTP2-1] [STDERR] PHP Warning: Invalid argument supplied for foreach() in /home/oldtownw/public_html/wp-admin/includes/plugin.php on line 1498
2019-10-26 09:23:23.038402 [NOTICE] [70.15.17.105:60492:HTTP2-1] [STDERR] PHP Warning: Invalid argument supplied for foreach() in /home/oldtownw/public_html/wp-admin/includes/plugin.php on line 1498
2019-10-26 09:21:42.715460 [NOTICE] [70.15.17.105:60408:HTTP2-1] [STDERR] PHP Warning: Invalid argument supplied for foreach() in /home/oldtownw/public_html/wp-admin/includes/plugin.php on line 1498
2019-10-26 09:21:42.715385 [NOTICE] [70.15.17.105:60408:HTTP2-1] [STDERR] PHP Warning: Invalid argument supplied for foreach() in /home/oldtownw/public_html/wp-admin/includes/plugin.php on line 1498
2019-10-26 09:20:42.718613 [NOTICE] [70.15.17.105:60359:HTTP2-1] [STDERR] PHP Warning: Invalid argument supplied for foreach() in /home/oldtownw/public_html/wp-admin/includes/plugin.php on line 1498
2019-10-26 09:20:42.718524 [NOTICE] [70.15.17.105:60359:HTTP2-1] [STDERR] PHP Warning: Invalid argument supplied for foreach() in /home/oldtownw/public_html/wp-admin/includes/plugin.php on line 1498Thanks in advance,
SeanThe page I need help with: [log in to see the link]
- The topic ‘Home Page Form Doesn’t Work with Cache’ is closed to new replies.