Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3rd Party Plugin Compatibility: AMP #688

Closed
raamdev opened this issue Feb 25, 2016 · 8 comments
Closed

3rd Party Plugin Compatibility: AMP #688

raamdev opened this issue Feb 25, 2016 · 8 comments

Comments

@raamdev
Copy link
Contributor

raamdev commented Feb 25, 2016

The AMP plugin adds support for the Accelerated Mobile Pages (AMP) Project. AMP is already used by Google and is becoming a big thing. The AMP WordPress plugin (developed by Automattic) already has 10k+ active installs.

Initial testing with Comet Cache v160223.1 indicates that AMP pages (which are generated by appending /amp/ to the URL, e.g., for /example-post/ you simply access /example-post/amp/ to get the AMP version) are cached fine by Comet Cache, resulting in a cache file stored in [...]/example-post/amp.html.

However, what is not working is the automatic clearing of the AMP cache file when the post changes. So if we edit the Example Post, Comet Cache clears the cache file for /example-post/ but does not clear the cache file for /example-post/amp/. We need to update Comet Cache to add support for the AMP plugin.

@theperfectwill
Copy link

+5

@jaswrks
Copy link

jaswrks commented Feb 25, 2016

This is an easy fix. We can change this line to the following:

return '(?:\/index|\/amp)?(?:\.|\/(?:page\/[0-9]+|comment\-page\-[0-9]+)[.\/])';

The same thing in this line also.

@jaswrks
Copy link

jaswrks commented Feb 25, 2016

We may also need to look at how permalinks are structured when this plugin is running, because we need to know if pagination occurs like /amp/page-2 or /page-2/amp for instance.

@raamdev
Copy link
Contributor Author

raamdev commented Feb 26, 2016

It appears that Comments, Pages, and Archives are not supported at all yet by the AMP plugin. The comments section and any links to comments do not appear on posts that are loaded via AMP.

The only other thing to note is that you can also load the AMP version of a post by appending ?amp=1, so we should be sure to consider that.

@raamdev
Copy link
Contributor Author

raamdev commented Feb 26, 2016

@jaswsinc FYI, I tested and confirmed the fix you noted above. It works great! Cache files for AMP versions of posts are now automatically cleared when a post cache needs to be cleared. :-) I've submitted a PR that I will be merging soon.

@raamdev raamdev self-assigned this Feb 26, 2016
@jaswrks
Copy link

jaswrks commented Feb 27, 2016

Cool. That's awesome!

raamdev added a commit to wpsharks/comet-cache-pro that referenced this issue Feb 27, 2016
@raamdev
Copy link
Contributor Author

raamdev commented Feb 27, 2016

Next Release Changelog:

  • Accelerated Mobile Pages (AMP) Compatibility: Added full support for Accelerated Mobile Pages via the AMP plugin. Comet Cache now works great alongside the AMP plugin. AMP-generated pages will be cached and those cache files will be intelligently cleared when necessary to keep things up-to-date. See Issue #688.

@raamdev raamdev closed this as completed Feb 27, 2016
@raamdev
Copy link
Contributor Author

raamdev commented Feb 27, 2016

Comet Cache v160227 has been released and includes changes from this GitHub Issue. See the v160227 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#688).

@wpsharks wpsharks locked and limited conversation to collaborators Feb 27, 2016
@raamdev raamdev removed their assignment Apr 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants