Google Drive thumbnails exceeding the speed limit of 403

We have a library app that shares photos / documents between users. The main thread and problem is this:

  • The user shares the file in an application that makes the file public.
  • Other users can request a list of files shared with the group.
  • They then ask for metadata about any files they want to list, including a thumbnail sketch, which we then display.

Usually the miniatures look fine, but sometimes we start getting 403. After a while they will start working again without changing anything. Several other items worth mentioning:

  • Actual API calls never hit any limit. We get this problem even when we just request one file. As far as we know, the console at Google does not show any exceeded limits.
  • If you open a thumbnail in a separate tab, it always seems to be no problem.
  • When it goes into this mode, all of our developers seem to be running into this at the same time, so we assume it is due to some limitation from our application, but we cannot find any limitations that we surpass. (Note: Our developers work from home, so everyone has a different IP address.)
  • Details of our 403 can be found below.

We assume this is unrelated to the following:

  • Doing too many requests at the same time as we get a problem even if we are making a single file.
  • Not authorized because (a) the files are public, (b) we just logged in, and (c) when you open a thumbnail in a tab, it displays just fine.

Any ideas?

Images with 403s

enter image description here

enter image description here

enter image description here

Screenshot of our Google Drive quotas enter image description here

+3


source to share


2 answers


After a few days of experimenting, I'm pretty sure this is caused by accessing the URLs in question from the environment localhost

. Whenever I click on production, the quota limit is allowed for the thumbnails that I try to access from Google.



While I don't have conclusive evidence that this is the case, it definitely makes sense given the observed behavior.

+2


source


My "solution" was to use a new one referrerpolicy

and set it to no-referrer

in the image element.

<img referrerPolicy="no-referrer" src="GOOGLE_THUMBNAIL_IMAGE_LINK"/>

      



The attribute is experimental according to MDN . At the time of this writing, it is only supported in Chrome and Firefox, so this is not a real fix. The theory behind it no-referrer

is that the image request is the same as the one used when you go directly to the link (where the thumbnail always seems to work).

+1


source







All Articles