使用getlist传输大部分评论,大幅减少网络请求数量并保证attention始终是最新的
This commit is contained in:
@@ -75,7 +75,7 @@ class Cache {
|
||||
resolve(null);
|
||||
} else if (target_version === res.version) {
|
||||
// hit
|
||||
console.log('comment cache hit', pid);
|
||||
//console.log('comment cache hit', pid);
|
||||
res.last_access = +new Date();
|
||||
store.put(res);
|
||||
let data = this.decrypt(pid, res.data_str);
|
||||
@@ -114,7 +114,7 @@ class Cache {
|
||||
data_str: this.encrypt(pid, data),
|
||||
last_access: +new Date(),
|
||||
});
|
||||
console.log('comment cache put', pid);
|
||||
//console.log('comment cache put', pid);
|
||||
if (++this.added_items_since_maintenance === MAINTENANCE_STEP)
|
||||
setTimeout(this.maintenance.bind(this), 1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user