Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I implement AMP in angular/ionic website?

Recently i've heard about the Accelerated Mobile Pages project, and read some info about it.

I wonder how to implement it for existing website that is built upon Ionic and Angular?

like image 205
Kobi Cohen Avatar asked Feb 23 '16 16:02

Kobi Cohen


1 Answers

Basically there is no nearly possible solution to do that. If you check the doc here.

Keep all third-party JavaScript out of the critical path

Third-party JS likes to use synchronous JS loading. They also like to document.write more sync scripts. For example, If you five ads, and each does three sync loads, with a 1 second latency connection, you’re in 18 seconds of load time just for JS loading.

AMP pages allow third-party JavaScript but only in sandboxed iframes. By banning them into iframes, they can’t block execution of the main page. Even if they trigger multiple style re-calculations, their tiny iframes have very little DOM.

Style-recalculations and layouts are typical to DOM size, so the iframe recalculations are very fast compared to a recalculating styles and layout for the page.

like image 168
Jimmy Tien Avatar answered Nov 26 '22 05:11

Jimmy Tien