简体   繁体   English

不使用RSA密钥或使用301重定向更新AMP缓存

[英]Update AMP Cache without RSA key or using 301 redirect

According to https://developers.google.com/amp/cache/update-cache to update the AMP cache I need to generate an RSA Key and place it at: https://example.com/.well-known/amphtml/apikey.pub 根据https://developers.google.com/amp/cache/update-cache更新AMP缓存,我需要生成RSA密钥并将其放置在: https : //example.com/.well-known/amphtml /apikey.pub

Unfortunately due to CMS restrictions (Shopify) that URL is not possible to set up. 遗憾的是,由于CMS限制(Shopify),无法设置URL。 Are there any other ways of updating the cache? 还有其他更新缓存的方法吗?

Would a 301 redirect work? 301重定向会起作用吗? The file would be actually stored on the CDN, different domain, something like: https://cdn.shopify.com/s/files/1/3201/2492/files/apikey.pub 该文件实际上将存储在CDN的不同域中,例如: https : //cdn.shopify.com/s/files/1/3201/2492/files/apikey.pub

Thank you 谢谢

I have used URL redirect (provided by Shopify) to link images in Outlook signatures. 我已经使用URL重定向(由Shopify提供)来链接Outlook签名中的图像。 So yes, my guess is that it should work. 所以是的,我的猜测是它应该起作用。

Try the following: 请尝试以下操作:

  1. Place the RSA key in Google Drive (since Shopify will not allow .pub files as far as I am aware) - Don't forget make the file public so Google can access it. 将RSA密钥放在Google云端硬盘中(因为据我所知Shopify不允许使用.pub文件)-不要忘记将文件公开,以便Google可以访问它。
  2. Create a URL redirect linking the location of your RSA key with the link https://example.com/.well-known/amphtml/apikey.pub . 创建URL重定向,以链接RSA密钥的位置和链接https://example.com/.well-known/amphtml/apikey.pub

Let us know how it goes. 让我们知道怎么回事。

Hope this helps. 希望这可以帮助。

您还可以考虑获取缓存的AMP页面,该页面还会自动更新AMP缓存(前提是您的源内容已适当到期)。

What Hamza suggested sounds like it might work, however, here is my recommendation: Hamza建议的内容听起来可能可行,但是,这是我的建议:

Send the pub key and your reason for requiring it on the server to Shopify. 将发布密钥和您要求服务器上的发布密钥的原因发送给Shopify。 If you have Shopify Plus, you will not be the first person requested things and they will accommodate you by placing the key at the desired location. 如果您有Shopify Plus,您将不是第一人要求的东西,他们会通过将钥匙放在所需的位置来容纳您。

Sorry it is not more technical, but you are truly bound your CMS. 抱歉,这不是技术性的内容,但您确实受CMS的约束。

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

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