Connection Lost issue
When updating posts or pages on Wordpress, I receive and error:" Connection lost. Saving has been disabled until you’re reconnected. We’re backing up this post in your browser, just in case." After deactivating and activating plugins, the Amp plugin is the culprit. When deactivated a post or page is updated immediately. When activated and trying to save a post I receive a connection error after 30 seconds and after a minute or so I receive a 504- Gateway timeout. When I refresh the page it saves almost instantly. Any help would be appreciated on eliminating this issue with the AMP plugin, thank you.
Which mode are you in? Classic, Paired, or Native?
I am in paired mode.
Do you have a persistent object cache plugin enabled? That would be the first thing time able that would improve the performance not only of the AMP plugin but of your entire site generally. Also try to make sure you are on PHP 7+.
Thanks for your reply's. There are no Cache plugins installed and I am using PHP 7.0
Try enabling a persistent object cache plugin (e.g. in conjunction with Memcached or Redis): https://codex.wordpress.org/Class_Reference/WP_Object_Cache#Persistent_Cache_Plugins
I use https://wordpress.org/plugins/wp-redis/
Thank you, regarding Redis, does my host server need to have this or does it need to be installed? Or does the plugin work as is when activated?
It's something your host has to provide.
Thanks, I do not think they do but I will check. So from what you are telling me this plugin will not work without giving me a connection error unless I use some sort of object cache plugin?
Not necessarily, but object caching should help. If your server is under-powered then you may need to remain on the classic mode.
As an alternative test, try going to a URL on your site and include ?amp_validate in the URL. If that takes a very long time to respond, then that is why the timeout may be happening.
Thanks, tried your suggestion and the site loaded up in 2 seconds.
The other thing to make sure of is that loopback requests work properly. For example, try scheduling a post for publishing a couple minutes in the future. If the post never gets published and instead you see a "Missed Schedule" message, then that indicates that WordPress isn't able to make an HTTP request back onto itself. This is required for the AMP validation to work properly.