Search code examples
amp-htmlpagespeed

LCP (PageSpeed) in AMP Project - Boilerplate amp tag had gotten worse LCP


I want to reduce the LCP in my amp web. I realize that this problem come from the style amp-boilerplate tag:

 <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>

I think thas this tag has my web start to print when the resources will be ready, but it is getting worse the LCP in PageSpeed.

How could i edit this tag to improve LCP in PageSpeed?

Thanks!


Solution

  • You CANNOT edit the boilerplate at all. Modifying even slightly will break AMP entirely.

    Unfortunately, you will need to review your code entirely.

    However, using a CDN has seen to improve LCP "Score" considerably.