First off, you're right: any metric can be gamed. Even so, Google is already using performance to factor into its algorithm, so some level of reasonable accuracy must have already been agreed upon.
Ensuring a certain level of performance is not a very easy problem to solve. But it's doable.
Myself and a few others sat down with the AMP team awhile back and chatted about what that would look like and there were definitely a few different layers that would be needed to get it to work.
The first is already in progress. There's a spec for something called "Feature Policy" (https://wicg.github.io/feature-policy/). Feature Policy would let you tell the browser you don't need certain features which would in turn let browsers take shortcuts (so to speak).
For example, you could declare that you will not be allowing document.write. Enough features being declared could serve as a way for Google (and others) to say "Ok, this is going to be reasonably fast."
There's more needed of course: we had discussions about a standard related to declaring a limit on asset sizes, etc. But it's a start. And while it will always be a little fuzzy, the same is true of AMP. It's completely possible to build a slow AMP page.
The best Google can do is say "if they're doing X, then the odds are good that it's performant".
> Ensuring a certain level of performance is not a very easy problem to solve.
What I'm getting at is maybe AMP is Google's way to make the problem easy. Sometimes when a general problem is difficult, you're better adding restrictions to make the problem tractable.
> It's completely possible to build a slow AMP page.
Can you elaborate? How easy would it be to test AMP pages for that?
> What I'm getting at is maybe AMP is Google's way to make the problem easy. Sometimes when a general problem is difficult, you're better adding restrictions to make the problem tractable.
It absolutely is! (Sorry if I made it sound like it wasn't). That's what the goal is of Feature Policy and other standards too: to add restrictions to make it easier to solve.
> Can you elaborate? How easy would it be to test AMP pages for that?
I keep meaning to make an example, but real work gets in the way. :)
Basic gist though is that AMP is, again, only a fuzzy approximation of good performance. You can still mess it up.
As for testing, the best thing to do is probably test from the origin server. That way you eliminate the Google cache layer and just focus on what the format itself actually accomplishes.
The conclusion, for anyone who doesn't want to click through, is that the vast majority of the performance benefits don't come from AMP itself. They come from A) the Google cache layer and B) the fact that Google preloads the AMP page in the background before you click on it.
> What we know about AMP is that the technical standard in itself enforces good performance. For example, CSS is limited to 50KB and only inline, custom JS is not allowed (other than via an iframe method), and all images are guaranteed to be lazy loading.
Hence, this is why AMP pages load instantly compared to a “normal” web page. It’s enforced by the standard. Right?
Wrong.
If you're including several MBs of CSS and JS in a render blocking manner and even more MBs of non-lazy loading images (which really isn't unusual) you're going to have a significantly slower page. There's a lot of hate for AMP but those restrictions make a lot of sense.
Ensuring a certain level of performance is not a very easy problem to solve. But it's doable.
Myself and a few others sat down with the AMP team awhile back and chatted about what that would look like and there were definitely a few different layers that would be needed to get it to work.
The first is already in progress. There's a spec for something called "Feature Policy" (https://wicg.github.io/feature-policy/). Feature Policy would let you tell the browser you don't need certain features which would in turn let browsers take shortcuts (so to speak).
For example, you could declare that you will not be allowing document.write. Enough features being declared could serve as a way for Google (and others) to say "Ok, this is going to be reasonably fast."
There's more needed of course: we had discussions about a standard related to declaring a limit on asset sizes, etc. But it's a start. And while it will always be a little fuzzy, the same is true of AMP. It's completely possible to build a slow AMP page.
The best Google can do is say "if they're doing X, then the odds are good that it's performant".