diff --git a/plugins/techdocs-backend/src/service/helpers.ts b/plugins/techdocs-backend/src/service/helpers.ts index 4a736f7388..012061dc0a 100644 --- a/plugins/techdocs-backend/src/service/helpers.ts +++ b/plugins/techdocs-backend/src/service/helpers.ts @@ -120,6 +120,16 @@ export class DocsBuilder { } } + // TODO: Better caching for URL. + if (type === 'url') { + const builtAt = buildMetadataStorage.getTimestamp(); + const now = Date.now(); + + if (builtAt > now - 1800000) { + return true; + } + } + this.logger.debug( `Docs for entity ${getEntityId(this.entity)} was outdated.`, );