[英]Google Drive Thumbnails getting 403 Rate-Limit Exceeded
We have an application with a library feature that shares photos/documents between users. 我们有一个具有库功能的应用程序,可以在用户之间共享照片/文档。 The basic flow and problem is as follows:
基本流程和问题如下:
Usually the thumbnails come up just fine but sometimes we begin getting 403's. 通常缩略图很好但有时我们开始得到403。 After a while they will begin working again without us changing anything.
过了一会儿,他们将重新开始工作而我们不做任何改变。 A few other items worth mentioning are:
其他一些值得一提的项目是:
We are guessing it isn't related to the following: 我们猜测它与以下内容无关:
Any ideas? 有任何想法吗?
Screenshot of our Google Drive quotas 我们的Google云端硬盘配额的屏幕截图
After a few days of experimentation, I'm pretty sure this is caused by accessing the URLs in question from a localhost
environment. 经过几天的实验,我很确定这是因为从
localhost
环境访问有问题的URL。 Whenever I push to production, the quota limit resolves itself for thumbnails I'm attempting to access from Google. 每当我推向制作时,配额限制都会自动解决我试图从Google访问的缩略图。
While I don't have conclusive proof that this is the case, it definitely makes sense given the observed behavior. 虽然我没有确凿的证据证明这是事实,但鉴于观察到的行为,它绝对有意义。
My "solution" was to use the new referrerpolicy
and set it to no-referrer
in the image element. 我的“解决方案”是使用新的
referrerpolicy
并在image元素中将其设置为no-referrer
。
<img referrerPolicy="no-referrer" src="GOOGLE_THUMBNAIL_IMAGE_LINK"/>
The attribute is experimental according to MDN . 根据MDN,该属性是实验性的。 At time of writing, it's supported on Chrome and Firefox only, so not a real fix.
在撰写本文时,它仅支持Chrome和Firefox,因此不是真正的解决方案。 The theory behind it working is the
no-referrer
means the image request is the same as the one used when you go directly to the link (where the thumbnail seems to always work). 它背后的理论是
no-referrer
意味着图像请求与直接转到链接时使用的图像请求相同(缩略图似乎始终有效)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.