简体   繁体   中英

Google Apps Script Caching Large Data

I'm writing a script for Google Spreadsheet that pulls financial data from an external server.

The live feed is a single JSON which contains all the data required.

However I'm faced with the problem of values taking very long to load because it fetches the JSON for every cell with my function. I could have hundreds of cells with functions like these to get the required data in the JSON file I want: =myFinancialData('data1') , =myFinanacialData('data2') , etc.

I read about Google's cache service but it seems like my dataset is larger than what is allowed. I also tried storing individual data values (eg data1 , data2 ) as individual cache but the script times out after exceeding the maximum execution time.

Is there a more efficient way to do such a thing?

尝试将数据存储在ScriptDB中,该数据库具有较高的配额(50MB)

Put the data direct into the spreadsheet. ... why: At some point the data will need to go into the spreadsheet so it can do your calculations etc. Even if you use a custom function, your data will still end up stored in the sheet. I suspect you don't gain by using a cache. Also custom functions can be slow to update, often over 3 seconds to kick in, sometimes over 10.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM