Amp-wp: Comments posted not appearing.

Created on 7 Feb 2018  路  11Comments  路  Source: ampproject/amp-wp

When posting a comment as a logged in user, the comment is not picked up and no load button is shown. Reloading the page does show the comment though.

Public posted comments are also shown as expected.

Blocked

Most helpful comment

@westonruter Looking more into this and it appears that the cache is browser based; The request is not being made as it's loading from disk cache. see below:
screen shot 2018-03-28 at 13 27 54

This problem is not just logged in, but all users. If a comment is posed within the first 15 seconds, it works, since it hasn't yet done a request. But every request after that is returned from disk cache so it never updates. @ThierryA also confirmed it on a VIP install.

As mentioning to @ThierryA , I feel this is an issue with amp-live-list as it should be aware of disk caching, and should probably include the current timestamp with the request to avoid the cache.
I have posted an issue here https://github.com/ampproject/amphtml/issues/14278

The PR https://github.com/Automattic/amp-wp/pull/942 does solve this by setting the last updated to the last comment to keep the next poll with the latest timestamp. @ThierryA mentioned that he could test it.

All 11 comments

I have done some extensive testing with various caching plugins, and the results show that plugin based caching is not too much of an issue.
However, Server side caching may prove to be an issue as this is a separate layer between the WordPress login and the server request.

I think more testing on server based caching systems like WP Engine, still to be done.

@DavidCramer OK, you'll be doing that? I think what is in order is to test on a live environment where caching is enabled for both Pantheon (e.g. https://live-ampconfdemo.pantheonsite.io/) and WP Engine and then compare results of commenting while logged-in vs not logged-in.

Ye, i was intending on doing that regardless. I'll get onto it in the morning.

@westonruter Looking more into this and it appears that the cache is browser based; The request is not being made as it's loading from disk cache. see below:
screen shot 2018-03-28 at 13 27 54

This problem is not just logged in, but all users. If a comment is posed within the first 15 seconds, it works, since it hasn't yet done a request. But every request after that is returned from disk cache so it never updates. @ThierryA also confirmed it on a VIP install.

As mentioning to @ThierryA , I feel this is an issue with amp-live-list as it should be aware of disk caching, and should probably include the current timestamp with the request to avoid the cache.
I have posted an issue here https://github.com/ampproject/amphtml/issues/14278

The PR https://github.com/Automattic/amp-wp/pull/942 does solve this by setting the last updated to the last comment to keep the next poll with the latest timestamp. @ThierryA mentioned that he could test it.

It looks like the issue was confirmed to be an issue in amp-live-list itself. Let's wait to see what happens with https://github.com/ampproject/amphtml/issues/14278. Thanks for opening that.

I've made a PR https://github.com/ampproject/amphtml/pull/14662 that adds a last check timestamp to the polling url, which should allow bypassing of the cache, and solve the issue. Lets hope they can review it quickly.

@DavidCramer awesome! One thing needed then in this plugin: please open a PR to add amp_last_check_time to the list of query params which are removed:

https://github.com/Automattic/amp-wp/blob/b53de14a00e7302ecc967aa3a798e7fca3eddbf1/includes/class-amp-theme-support.php#L287-L291

@westonruter I was about to do that ;)

And it's been merged!

Will Write Testing Steps

Hi Claudio,
I'll write some testing steps for this, and link to some pages.

Confirmation that the changes to amp-live-list have been deployed and the caching issue is no longer happening.
screen shot 2018-04-23 at 10 51 54

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maciejmackowiak picture maciejmackowiak  路  5Comments

fumikito picture fumikito  路  5Comments

miina picture miina  路  3Comments

luizeof picture luizeof  路  4Comments

miina picture miina  路  5Comments