diff --git a/src/Logic/Web/LinkedDataLoader.ts b/src/Logic/Web/LinkedDataLoader.ts index a5b21d63d..41c1e661d 100644 --- a/src/Logic/Web/LinkedDataLoader.ts +++ b/src/Logic/Web/LinkedDataLoader.ts @@ -641,12 +641,17 @@ export default class LinkedDataLoader { return results } + private static veloparkCache : Record = {} + /** * Fetches all data relevant to velopark. * The id will be saved as `ref:velopark` * @param url */ public static async fetchVeloparkEntry(url: string): Promise { + if(this.veloparkCache[url]){ + return this.veloparkCache[url] + } const withProxyUrl = Constants.linkedDataProxy.replace("{url}", encodeURIComponent(url)) const optionalPaths: Record> = { "schema:interactionService": { @@ -702,6 +707,7 @@ export default class LinkedDataLoader { p["ref:velopark"] = [section] patched.push(LinkedDataLoader.asGeojson(p)) } + this.veloparkCache[url] = patched return patched } }