From e38b14b77aa5430ba92052dfd28bf2146c6bbbc7 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Wed, 2 Feb 2022 02:36:49 +0100 Subject: [PATCH] Force evaluation of lazy tags during caching --- Logic/MetaTagging.ts | 8 +++++++- scripts/generateCache.ts | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Logic/MetaTagging.ts b/Logic/MetaTagging.ts index 3cca4b76a..a73476d36 100644 --- a/Logic/MetaTagging.ts +++ b/Logic/MetaTagging.ts @@ -28,7 +28,8 @@ export default class MetaTagging { state?: { allElements?: ElementStorage }, options?: { includeDates?: true | boolean, - includeNonDates?: true | boolean + includeNonDates?: true | boolean, + evaluateStrict?: false | boolean }): boolean { if (features === undefined || features.length === 0) { return; @@ -72,6 +73,11 @@ export default class MetaTagging { } somethingChanged = true; metatag.applyMetaTagsOnFeature(feature, freshness, layer, state) + if(options?.evaluateStrict){ + for (const key of metatag.keys) { + feature.properties[key] + } + } } else { const newValueAdded = metatag.applyMetaTagsOnFeature(feature, freshness, layer, state) /* Note that the expression: diff --git a/scripts/generateCache.ts b/scripts/generateCache.ts index 32cc04024..b96851146 100644 --- a/scripts/generateCache.ts +++ b/scripts/generateCache.ts @@ -225,7 +225,8 @@ function sliceToTiles(allFeatures: FeatureSource, theme: LayoutConfig, relations {}, { includeDates: false, - includeNonDates: true + includeNonDates: true, + evaluateStrict: true });