AMP and Cloudflare
-
I have been using and evaluating AMP for about a month and have a generally positive opinion.
However, there is an issue with using /?amp vs /amp/ in URLs. I can’t find it now, but there was a support thread I found a while back talking about /amp/ being depreciated because some websites may use “amp” as a category or tag, and that could cause some issues.
The problem that I have seen is this does not work with Cloudflare’s “Automatic Platform Optimization for WordPress”, which uses Cloudflare’s cache to serve a static version of a site without interference… basically, if I update something, or a visitor adds a comment, Cloudflare automatically knows (via its plugin) to update that post or page.
However, since the AMP plugin uses a query string to identify amp pages, Cloudflare’s cache does not store a static version for AMP… at least, not automatically. I brought this up on the Cloudflare Support Forum last month: https://community.cloudflare.com/t/apo-and-amp-pages/227717
The workaround has been to create a Page Rule that essentially states if
https://example-website/*/?amp*
then Cache Everything. It should be noted that I can create a Page Rule using Cache Everything because I am using a paid version of Cloudflare. This limited solution is not available to Cloudflare’s free users.Additionally, using Cloudflare’s Page Rule means that any time there is a post change or visitor comments (and you can’t really be on top of that 24/7), someone has to go into Cloudflare and manually purge the cache for that page. Cloudflare’s “Automatic Platform Optimization for WordPress” also recognizes WordPress cookies and knows when to serve a cached version of the website or a live version. That does not work if a page is under a Cache Everything rule.
I apologize for the longwinded post but the issue of using a query string rather than having amp within the actual path has become a big problem since the largest portion of my traffic is visiting the AMP version of posts.
I don’t know what percentage of AMP plugin users are also Cloudflare users, but I am kinda surprised this problem has not come up more often.
It seems the only thing that can fix this is giving websites the option between using query string and path. Does that make sense?
- The topic ‘AMP and Cloudflare’ is closed to new replies.