AMP 项目中的 LCP (PageSpeed) - Boilerplate amp 标签变得更糟 LCP

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

我想减少放大器网络中的 LCP。我意识到这个问题来自样式 amp-boilerplate 标签:

 <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>

我认为这个标签让我的网站在资源准备就绪时开始打印,但 PageSpeed 中的 LCP 越来越差。

我如何编辑此标记以改进 PageSpeed 中的 LCP?

谢谢!

您根本无法编辑样板文件。 即使稍作修改也会完全破坏 AMP。

很遗憾,您需要完整地检查您的代码。

但是,使用 CDN 可以显着提高 LCP“得分”。