简体   繁体   中英

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

Unfortunately due to CMS restrictions (Shopify) that URL is not possible to set up. Are there any other ways of updating the cache?

Would a 301 redirect work? 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

Thank you

I have used URL redirect (provided by Shopify) to link images in Outlook signatures. 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.
  2. Create a URL redirect linking the location of your RSA key with the link 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:

Send the pub key and your reason for requiring it on the server to 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.

Sorry it is not more technical, but you are truly bound your CMS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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