I currently have an Apps Script Editor add-on that works with Google Sheets. It has a custom function implementation that uses the built in UrlFetchApp.fetch()
to fetch external data. The add on is growing quickly and pretty much daily I'm seeing this error:
Exception: Service invoked too many times for one day: urlfetch.
I've implemented a cache to save this data for the maximum time of 6 hours, but even with this optimization it seems like it's not enough to account for the volume of requests users are making.
In essence the pseudo code is:
Check cache for data:
if data:
use data and return to user
else:
newData = UrlFetchApp.fetch(url)
cache.put(key, newData, 21600)
return newData to user
I've contacted Google and was told that it's not possible to increase this quota limit and was told to post here to see if anyone can help solve this.
With that being said my question: how is an add on with a custom function expected to scale when this quota only allows for 100,000 requests/day? It seems like this makes it nearly impossible to scale to 1000, 10,000, 100,000 users.
Any guidance or advice on how to tackle this would be amazing, thanks.