Friday, August 16, 2019

AMP Server-Side Rendering

Sebastian Benz (Hacker News):

AMP now officially supports a technique called server-side rendering (SSR) which you can apply to your AMP pages to make them load even faster. Our tests show increases of up to a whopping 50% on the popular FCP metric. The Google AMP Cache has utilized this technique for a while, but now you can also use it on your own domain!

[…]

SSR is a technique for improving first-contentful-paint times (FCP) for frameworks rendering the page client-side such as React or Vue.js. The downside of client-side rendering is that all Javascript necessary to render the page needs to be downloaded first. This delays the time until users can see the actual content of the page. To alleviate this, both React and Vue.js support pre-rendering the DOM on the server on navigation requests. Rendering is then picked up by the client-side Javascript, a process called (re)hydration. Users will be able to see content much faster as a result.

[…]

With this attribute being set, the validator treats SSR’d AMP as valid AMP. SSR’d AMP optimizations break the rules of the AMP spec, hence making the document invalid, which is why it’s necessary to indicate this case with this new flag. With the flag and the optimizations both being in place, the document is considered valid and you’re good to go.

amluto:

Wait, does this mean that websites could serve plain HTML but set this flag and this avoid being penalized by Google? Win!

Ricky Mondello:

If only the industry had thought of servers directly sending markup to render pages from the beginning. 🙄

Update (2019-08-22): Curtis Herbert:

Piece by piece AMP stops being about a “lightweight page” and more a full replacement to the standards that power the web.

They are using thier search engine dominance to force everyone to adopt this stuff, otherwise no one would. No one needed or asked for this stuff.

Chrome pulled out all the stops to woo over the tech space over the course of a decade, only to pull the rug out from under things that are Bad For Google (content blockers) now that they are the dominant browser.

Think AMP isn’t going to go the same way?

See also: How can we destroy AMP?.

Comments RSS · Twitter

Leave a Comment