forked from MapComplete/MapComplete
Add cache timeout
This commit is contained in:
parent
823768bbc9
commit
576fd8ff40
5 changed files with 30 additions and 1 deletions
|
@ -15,6 +15,10 @@ export default class LocalStorageSaver implements FeatureSource {
|
|||
this.features = source.features;
|
||||
|
||||
this.features.addCallbackAndRun(features => {
|
||||
|
||||
const now = new Date().getTime()
|
||||
features = features.filter(f => layout.data.cacheTimeout > Math.abs(now - f.freshness.getTime())/1000)
|
||||
|
||||
if (features === undefined) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue