If you’re reading this on a phone, and you got here via a Google search, you might have noticed that my site loaded rather quickly. Indeed, thanks to Google AMP (accelerated mobile pages), the entire page was pre-rendered by your mobile device before you even tapped the link. So cool, right!? On top of providing visitors with a quicker experience, valid AMP pages also require site owners to forego much of the cruft typically found on websites these days, resulting in a much more pleasurable reading experience.
Converting my site, as simple as it is, to be totally valid AMP wasn’t as easy as I expected it to be, however.
For the contact form, I decided to build a proper backend using AWS Lambda. This was also surprising more complex than I initially expected it to be, mainly due to the inability to change the “Content-Type” header to something other than “multipart/form-data”. The AWS API Gateway doesn’t really support this particular content-type, so I ended up extracting and parsing the raw multipart request body to get the form field values. Ick.
Overall, I think AMP is a net-positive for the web. I’m looking forward to see how the project evolves, though I wouldn’t want to be the one on the hook for having to make a larger site pass AMP validation.