diff --git a/.changeset/techdocs-sakta-vi-gar.md b/.changeset/techdocs-sakta-vi-gar.md new file mode 100644 index 0000000000..183d90300b --- /dev/null +++ b/.changeset/techdocs-sakta-vi-gar.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs-backend': patch +--- + +Fixed a bug preventing cache from being enabled in TechDocs "recommended" deployment mode. diff --git a/plugins/techdocs-backend/src/service/router.ts b/plugins/techdocs-backend/src/service/router.ts index 8f48342683..b54714101f 100644 --- a/plugins/techdocs-backend/src/service/router.ts +++ b/plugins/techdocs-backend/src/service/router.ts @@ -60,6 +60,7 @@ type RecommendedDeploymentOptions = { logger: Logger; discovery: PluginEndpointDiscovery; config: Config; + cache?: PluginCacheManager; }; /** @@ -89,7 +90,7 @@ export async function createRouter( // Set up a cache client if configured. let cache: TechDocsCache | undefined; const defaultTtl = config.getOptionalNumber('techdocs.cache.ttl'); - if (isOutOfTheBoxOption(options) && options.cache && defaultTtl) { + if (options.cache && defaultTtl) { const cacheClient = options.cache.getClient({ defaultTtl }); cache = TechDocsCache.fromConfig(config, { cache: cacheClient, logger }); }