2
我有一个包含大量自定义函数调用的工作表。我想永久缓存结果。 到现在为止,我已经使用了缓存服务,但限于六个小时。 有没有办法永久缓存结果? 我在评论here中读到,可以在用户的浏览器中缓存数据。我应该如何实现这一目标?Google Apps脚本 - 永久缓存
谢谢!
编辑: 感谢哔叽亨德里克斯的建议,我是能够永久使用相同的方法作为高速缓存服务的缓存结果:
var scriptProperties = PropertiesService.getScriptProperties();
if(getCachedVariable(variableName) == null){
// Results aren't in cache, get them and save them
scriptProperties.setProperty(variableName,value);
}
return getCachedVariable(variableName);
function getCachedVariable(variableName){
return scriptProperties.getProperty(variableName);
}
谢谢,我也没多想使用这种方式。会放弃并更新。 – Stanislasdrg