diff options
author | Vitaly Takmazov | 2018-10-24 09:24:22 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-10-24 09:24:22 +0300 |
commit | d01d6bb37bac8dd1f2d3ecbd64b3ee7d0c761873 (patch) | |
tree | 265201ce8ade813aab028fb32cfd6893dc235fae | |
parent | 6b8bc1b2f098d42fa821a67887e85260483c81f3 (diff) |
Revert "scripts: stupid users cache"
This reverts commit 6b8bc1b2f098d42fa821a67887e85260483c81f3.
-rw-r--r-- | juick-server/src/main/assets/scripts.js | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/juick-server/src/main/assets/scripts.js b/juick-server/src/main/assets/scripts.js index add5105b..51314b0b 100644 --- a/juick-server/src/main/assets/scripts.js +++ b/juick-server/src/main/assets/scripts.js @@ -603,26 +603,20 @@ function addTag(tag) { return false; } -var users = {}; - function fetchUserUri(dataUri, callback) { - if (users[dataUri]) { - callback(users[dataUri]); - } else { - let data = new FormData(); - data.append('uri', dataUri); - fetch('/u/', { - method: 'POST', - body: data - }).then(handleErrors) - .then(response => { - return response.json(); - }) - .then(json => { - users[dataUri] = json; - callback(json); - }); - } + let data = new FormData(); + data.append('uri', dataUri); + fetch('/u/', { + cache: 'force-cache', + method: 'POST', + body: data + }).then(handleErrors) + .then(response => { + return response.json(); + }) + .then(json => { + callback(json); + }); } /******************************************************************************/ |