chrome.storage.sync配额仅为100kb-是否始终在RAM中?

时间:2018-10-19 20:49:09

标签: google-chrome firefox google-chrome-extension firefox-webextensions

例如:

chrome.storage.sync.get(resp => console.log(resp['Am I from RAM or disk?'])

“缓存”响应以加快访问速度是一种好习惯吗?例如:

const storageSync = {};

chrome.storage.sync.get(resp => storageSync['key'] = resp['key']);

someAction(storageSync['key']);
anotherAction(storageSync['anotherKey']);
foobar(storageSync['xxxxxxx'])
// And use in other parts of the code also

还是每次需要获取价值时都可以使用此API?

对于将来的访问者-文档链接(当前没有有关RAM的信息): https://developer.chrome.com/extensions/storage

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage

0 个答案:

没有答案