mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 22:13:02 +00:00
initial commit
This commit is contained in:
17
src/backend/cache.ts
Normal file
17
src/backend/cache.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
var _fakeLRUcount = 0;
|
||||
export const fakeDemoRedisCache = {
|
||||
_cache: {},
|
||||
get: (key) => {
|
||||
let cache = fakeDemoRedisCache._cache[key];
|
||||
_fakeLRUcount++;
|
||||
if (_fakeLRUcount >= 10) {
|
||||
fakeDemoRedisCache.clear();
|
||||
_fakeLRUcount = 0;
|
||||
}
|
||||
return cache;
|
||||
},
|
||||
set: (key, data) => fakeDemoRedisCache._cache[key] = data,
|
||||
clear: () => fakeDemoRedisCache._cache = {}
|
||||
};
|
Reference in New Issue
Block a user