Если вы используете Node, я бы рекомендовал:
Object.keys(obj).forEach((key, index) => {
console.log(key);
});
Вы можете установить заголовок Cache-Control
так:
return fetch(url, {
headers: {
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache',
'Expires': 0
}
}).then(function (res) {
return res.json();
}).catch(function(error) {
console.warn('Request Failed: ', error);
});