简体   繁体   English

Google AMP缓存-可以强制从缓存加载index.html吗?

[英]Google AMP Cache - hot to force loading index.html from cache?

Is there any way how to force loading main homepage (index.html) to load from AMP Cache? 有什么方法可以强制从AMP Cache加载主主页(index.html)?

I have all images loaded from Cache according to manual: https://developers.google.com/amp/cache/overview 我已按照手册从Cache加载了所有图像: https : //developers.google.com/amp/cache/overview

But in DevTools audit there is still an error for the homepage (not being served through http/2 - from the cache) 但是在DevTools审核中,主页仍然存在错误(未通过http / 2提供服务-从缓存中获取) 开发工具审核

I'm not sure exactly what you mean but think you may be misunderstanding the point of the AMP cache. 我不确定您的确切意思,但认为您可能误解了AMP缓存的要点。

The Google AMP Cache is not like a CDN (Content Delivery Network) that always sits in front of your site, though in certain instances it acts like one. Google AMP缓存不同于始终位于您网站前面的CDN(内容分发网络),尽管在某些情况下它的作用类似于。

The Google AMP Cache is automatically populated by Google when it crawls your site. Google会对您的网站进行爬网时会自动填充Google AMP缓存。 Any searches on Google while on mobile will then serve your AMP pages, rather than your normal pages, and will also serve them from the Google AMP cache rather than from your domain. 然后,在移动设备上通过Google进行的任何搜索都将投放您的AMP页面,而不是您的普通页面,并且还将通过Google AMP缓存而不是您的域来投放它们。 This is done for a number of reasons, but primarily to create the “instant loading” effect that AMP gives when loaded from Google Search results (aka Search Engine Results Page or SERP). 这样做有多种原因,但主要是为了创建AMP从Google搜索结果(也称为搜索引擎结果页或SERP)加载时产生的“即时加载”效果。 In this case the whole page including the index page is served from the Google AMP Cache. 在这种情况下,包括索引页面在内的整个页面都由Google AMP缓存提供。

Other sites and domains can also decide to display AMP pages instead of your HTML pages if they want, and can decide to serve them from the Google AMP cache, from their own AMP cache (though, other than Google, only Cloudflare have implemented their own AMP Cache AFAIK) or directly from your home page (in which case there is no cache used). 其他网站和域也可以根据需要决定显示AMP页面而不是HTML页面,并且可以决定从Google AMP缓存,自己的AMP缓存中为它们提供服务(尽管除了Google之外,只有Cloudflare实施了自己的AMP缓存 AFAIK)或直接从您的主页(在这种情况下,不使用缓存)。 Twitter for example automatically replaces links with their AMP equivalents but loads from the real domain so is fast (due to AMP) but not “instant” (like it is in the Google Search Results). 例如,Twitter自动用其AMP等效项替换链接,但从真实域加载,因此速度很快(归因于AMP),但不是“即时”的(如Google搜索结果中的那样)。

So you, as a site owner, don't decide when to use the AMP Cache - the calling application (eg Google SERPS, Twitter) decides that. 因此,作为网站所有者,您无需决定何时使用AMP缓存-调用应用程序(例如Google SERPS,Twitter)来决定。 And if the calling app/page doesn't use an AMP Cache, then it is served directly from your domain and therefore whatever technology your domain supports (eg HTTP/1.1 or HTTP/2). 而且,如果调用的应用程序/页面未使用AMP缓存,则直接从您的域提供服务,因此也将直接从您的域提供服务(例如HTTP / 1.1或HTTP / 2)。 You can of course give out the AMP Cache URL instead of your real one if you want. 当然,您可以根据需要提供AMP缓存URL,而不是实际的URL。

You seem to suggest you have altered your page to replace all images and the like with references to the AMP cache - is that so? 您似乎建议您已更改页面,以使用对AMP缓存的引用替换所有图像等,是这样吗? If so that sounds like a bad idea, as the cache is loaded from your site which now depends on the cache, which is loaded from your site, which is... etc. 如果是这样,这听起来是个坏主意,因为缓存是从您的站点加载的,而缓存现在取决于缓存,而缓存是从您的站点加载的,等等。

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

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