简体   繁体   English

使用AMP缓存优化用户体验

[英]Using the AMP cache to optimize the user experience

I have recently been reading up on the AMP-CACHE and although the URL will change in Q1 2017 the question I'm trying to understand is how to optimize the experience for a mobile user. 我最近一直在阅读AMP-CACHE,尽管URL将在2017年第一季度更改,但我想了解的问题是如何为移动用户优化体验。

If you start with the view that AMP pages are the best way to show mobile users your content then if they find an AMP version of a page via Google shouldn't links take them to the AMP version of the site. 如果您首先认为AMP页面是向移动用户显示您的内容的最佳方式,那么如果他们通过Google找到页面的AMP版本,则不应将其链接到该网站的AMP版本。

And in that case should that be the google AMP Cache version? 在那种情况下,那应该是Google AMP缓存版本吗?

OR the underlying amp version that the site created. 或网站创建的基础amp版本。

In our case we have created an AMP version of our site 在我们的情况下,我们已经创建了网站的AMP版本

http://amp.sportsmole.co.uk http://amp.sportsmole.co.uk

You can obviously look at and link to pages on that but the implication of some of the documentation is that using the AMP cache version is even better? 您显然可以查看并链接到其上的页面,但是某些文档的含义是使用AMP缓存版本甚至更好?

Is it and how should one do that? 是吗,应该怎么做?

When I started looking at AMP pages I wondered about this but ignored it up until now. 当我开始查看AMP页面时,我对此感到疑惑,但直到现在,它还是忽略了它。 However, the more I read about the goal of the AMP Cache the more I wonder how to take advantage of it. 但是,我对AMP缓存的目标了解得越多,我就越想知道如何利用它。

Anyone have any ideas on how to use the AMP cache to make sure that the users get the fastest experience. 任何人都对如何使用AMP缓存有任何想法,以确保用户获得最快的体验。

You may probably want to check the Cache optimizations and modifications from Google documentation: 您可能需要检查Google文档中的缓存优化和修改

The Google AMP Cache performs optimizations and modifications, such as the following: Google AMP缓存执行优化和修改,例如:

  • Validates content is truly in AMP format, meeting all AMP performance goals. 真正以AMP格式验证内容,满足所有AMP性能目标。
  • Caches images and fonts in addition to AMP documents. 除AMP文档外,还缓存图像和字体。
  • Limits maximum image dimensions to prevent browser memory issues and poor responsiveness. 限制最大图像尺寸,以防止浏览器内存问题和较差的响应速度。
  • Various transformations to improve the delivery efficiency of images via the amp-img tag, such as: 可以通过amp-img标签进行各种转换以提高图像的传递效率,例如:
    • Removal of data that is invisible or difficult to see, such as certain metadata. 删除不可见或难以看到的数据,例如某些元数据。
    • Conversion of images to smaller and mobile-friendlier image formats, such as converting GIF, PNG, and JPEG format images to WebP in browsers that support WebP. 将图像转换为更小且适合移动设备的图像格式,例如在支持WebP的浏览器中将GIF,PNG和JPEG格式的图像转换为WebP。
    • Transformation of the image to a lower quality if the request includes the Save-Data header. 如果请求包含“保存数据”标头,则将图像转换为较低质量的图像。
    • Generation of alternatively sized versions and adding srcset attributes to support delivery of responsively sized images. 生成其他大小的版本并添加srcset属性以支持响应大小的图像的传递。
  • Serves over a secure channel (HTTPS) and uses the latest web protocols (SPDY, HTTP/2). 服务于安全通道(HTTPS)并使用最新的Web协议(SPDY,HTTP / 2)。
  • Sanitizes AMP documents to prevent XSS attacks based on incorrectly closed HTML tags, comments, and more. 对AMP文档进行消毒,以防止基于错误关闭的HTML标签,注释等进行XSS攻击。

In making the above transformations, the Google AMP Cache disregards the “Cache-Control: no-transform” header. 在进行上述转换时,Google AMP缓存会忽略“ Cache-Control:no-transform”标头。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM