Email Form + Caching = “Doh”

Email Form + Caching = “Doh”

Apparently, my email form has been broken for days, but of course no one could email me about it. I apologize to anyone who’s tried to reach me over the past week through that form, and wondered why the heck they didn’t get a response.

There were three problems relating to the server optimizations I’d recently made: 1. Moving wordpress into its own install directory broke some URLS on the contact form itself, so it wasn’t able to execute when you clicked “submit”. 2. Implementing caching: my email-dave.php file is a copy of index.php, which has all the wordpress goodness in it…including the “staticize” code that serves up cached versions of pages. So the changes I made to the URLS were not being served, because nothing triggered the “I am dirty” flag back to staticize. 3. After being staticized, the email form no longer can submit to itself and perform the actual sending of mail, with the send confirmation. It instead reloads the form, which in static form has all the PHP code stripped out! I added code to the staticize plugin to skip certain files to avoid this.

So the moral of the story is: * Don’t let Staticize touch your re-entrant PHP pages

0 Comments