Popular Posts
-
We can offer a wide variety of hosting options such as Amazon Web Services, Microsoft's Azure, Nexcess, WPengine, Liquid Web, Panthe...
-
Donald J. Trump has entered presidential politics like a force of nature, thrilling some, horrifying others, and contributing to a nominat...
-
ASPHostPortal.com - the leader of ASP.NET hosting provider launches Entity Framework 7 hosting with Fast Speed, Excellent Service, and C...
-
HostForLIFE.eu, a leading web hosting provider, has leveraged its gold partner status with Microsoft to launch its latest Umbraco 7.3.0 ...
-
The costs of setting up and maintaining a website can add up quickly and it is not an easy task to make the choices at the start and sta...
-
/EINPresswire.com/ -- SANTA FE, NM--(Marketwired - October 15, 2016) - CrowdReviews.com, an online platform for B2B service reviews, urges...
-
April 28, 2016 04:00 ET | Source: Research and Markets Dublin, April 28, 2016 (GLOBE NEWSWIRE) -- Research and Markets has announ...
-
Introduction The last 2 decades clearly reveal that the use of internet has grown up. Every tenth person in the world feels the requirem...
-
1011 8 hours ago from Steve Orchosky, UI/UX Web Designer Hey all! I was wondering what everyone uses to host your websites (...
-
And while mostly giving Google a pat on the back with this announcement, I felt like it stopped just short of a resounding end...
Blog Archive
- December (19)
- November (25)
- October (28)
- September (26)
- August (28)
- July (31)
- June (26)
- May (27)
- April (28)
- March (30)
- February (28)
- January (31)
- December (31)
- November (30)
- October (31)
- September (29)
- August (44)
- July (56)
- June (53)
- May (54)
- April (48)
- March (55)
- February (44)
- January (3)
- December (5)
- November (5)
- October (26)
- September (25)
- August (29)
- July (26)
- June (18)
- September (1)
About Me
Total Pageviews
Decentralized hosting of AMP’s JavaScript & NPM for the web
Every AMP HTML document must at the very least contain the following script tag that is loading AMP's JavaScript from the AMP CDN:
There has been some critique of this design decision so I wanted to take the time to explain the reasoning behind it and lay out how to do better in the future.
The most obvious consequence of centrally hosting the JavaScript is that every AMP page on the internet is always on the latest release. A pull request to AMP's GitHub that makes AMP faster is typically deployed to all AMP pages on the internet within 2 weeks, making all AMP pages faster at once. No page is left behind.
Another big benefit of loading the very same JS URLs on every page is that this leads to much, much better utilization and hit rate of the browser cache. If you've been to an AMP page on publisher X, going to another AMP page on publisher Y will now be faster and cost less bandwidth. AMP is currently in the process of shipping a foreign-fetch ServiceWorker that will make this even more impactful.
Finally, having all AMP pages use explicitly shared JavaScript opens up the possibility of additional optimization by the AMP Caches. While there are a set of requirements for AMP Caches, they don't actually need to use AMP's own JavaScript URLs. Knowing what version (the latest) of AMP a page is compatible with, they can then go and perform additional optimizations using similar techniques to an optimizing compiler. This would be infeasible if they'd need to support what would effectively be all AMP releases ever.
There are, of course, some valid reasons why using centrally hosted JS might not be such a great idea. We do mitigate some of them:
Having said this, the AMP Project is very interested in supporting decentralized hosting of its JavaScript files.
"Build a decentralized cross-internet 3P script repository with semver semantics."
Our idea is to build a decentralized cross-internet 3P script repository with semver semantics (Think NPM, but with first class support in the web platform and with multiple providers). That could achieve many of the same goals that I outlined above (AMP would mandate wildcarding the patch level in the semver version). Many of us had hopes that subresource integrity could bring some of the cross site caching benefits, but unfortunately that comes with privacy problems (it allows finding out which sites a user has been to) and thus cannot be taken advantage of in web browsers. By limiting such a feature to well known repositories that can be controlled by the user, one could get the clear benefits in a privacy friendly way.
Here is how this would look like:
With this a page author can say:
I think such a mechanism would be a great benefit to most web applications and would likely save users from downloading many petabytes of data every day.
Source: Decentralized hosting of AMP's JavaScript & NPM for the web
0 comments:
Post a Comment