Cache techdocs build using UrlReader (#3551)
* Better caching is coming when some backstage core features are in place. Currently let's just cache it for 30 minutes * Fixed prettier
This commit is contained in:
committed by
GitHub
parent
9b234443e7
commit
eeecfbf4a6
@@ -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.`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user