【发布时间】:2016-03-24 00:04:33
【问题描述】:
我在github上放了一些数据。
我使用节点模块“请求”从中获取数据。
在我在 github 上更新我的数据之后。
nodejs 仍然可以获取大约五分钟的旧数据。
这是我的代码的一部分。
var url = "https://raw.githubusercontent.com/Larry850806/facebook-chat-bot/master/db.json";
request({ url: url, json: true }, function(error, response, body){
if (!error && response.statusCode === 200) {
console.log(body); // Print the json response
// after I update data, body still get old data
}
});
我认为这是因为有缓存。
所以我不能得到“真实”的数据,而是旧的。
有没有办法获取最新的数据?
【问题讨论】: