Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
1st class support for PWAs that load AMP docs. #3742
Make it easy to build progressive web apps (PWAs) that load AMP documents as their primary content source. AMP documents in this model, would be the perma links, but a ServiceWorker can intercept them and instead deliver an app shell, which then loads the AMP document inside of it. Subsequent navigations would happen inside the app shell
The initial design doc is here: https://docs.google.com/document/d/1rvcFY3Zhg6oUmRtaceEdOYuwjciVaHnYIn_tMvGbRME/edit?usp=sharing
Having toyed with it a little now, I find this design working really well, especially the use of ShadowDOM root that enables SW intercepting requests, which allows seamless offline caching of AMP content.
The one hurdle I've encountered is that the AMP Cache doesn't allow CORS requests to AMP docs, so I had to rely on a CORS-enabled proxy to fetch the content from the client. Is this a strict limitation of the AMP Cache and clients are supposed to rely on a proxy/their own cache, or might this be allowed in the future?