Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  1. A user shares a file in the application which makes a file public unlisted.
  2. Other users can request the list of files currently shared with the group.
  3. They then request the meta data the about any files they want to list, which includes a thumbnail url which we then display.

Usually the thumbnails come up just fine but sometimes we begin getting 403's. After a while they will begin working again without us changing anything. A few other items worth mentioning are:

  1. The actual API calls never seem to hit any limits. We get this issue even when we are just requesting a single file. The console in Google doesn't show any exceeded limits as far as we can tell.
  2. If you open up the thumbnail in a separate tab it always seems to come up without any problem.
  3. When it goes into this mode all of our developers seem to hit it at the same time, hence we are guessing it is linked to some limit from our application but we can't seem to find any limits we are exceeding. (Note: Our developers work from home so they all have different IP addresses.)
  4. The details of our 403's can be found below.

We are guessing it isn't related to the following:

  1. Making too many requests concurrently since we get the problem even when we do a single file.
  2. Not being authorized since (a) the files are public unlisted, (b) we just logged in, and (c) when you open the thumbnail in a tab it shows up 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

like image 417
aashtonk Avatar asked Jun 15 '15 17:06

aashtonk


1 Answers

My "solution" was to use the new 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 time of writing, it's supported on Chrome and Firefox only, so not a real fix. 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).

like image 143
ElDog Avatar answered Sep 24 '22 10:09

ElDog