I have a google sheet that uses custom functions in apps script to retrieve some data from a third party API. Another web service uses a simple HTTP request to get values of cells that are based on those custom function values, with a request like:
https://sheets.googleapis.com/v4/spreadsheets/[SHEETID]/values/[SheetName]?majorDimension=ROWS&key=[API-KEY]
As long as someone is looking at the sheet or has looked at it recently (in the last 15 minutes or so), this all works fine. After about 15 minutes the google sheets API request starts returning #NAME?
instead of the cell value.
It seems like the cell values are being cached somewhere and this cache expires after a while. Is there anything I can do to keep the values alive longer or to force the apps script custom functions to execute when the API request comes in?