From f52486528bd216e705a745048e655c4a6520ccda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Mon, 8 Sep 2025 03:29:17 +0200 Subject: [PATCH] Cache generated swagger.json by default --- ArchiSteamFarm/IPC/ArchiKestrel.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ArchiSteamFarm/IPC/ArchiKestrel.cs b/ArchiSteamFarm/IPC/ArchiKestrel.cs index 93e5efee5..f282c0892 100644 --- a/ArchiSteamFarm/IPC/ArchiKestrel.cs +++ b/ArchiSteamFarm/IPC/ArchiKestrel.cs @@ -261,7 +261,11 @@ internal static class ArchiKestrel { app.MapControllers(); // Add support for OpenAPI, responsible for automatic API documentation generation, this should be on the end, once we're done with API - app.MapOpenApi("/swagger/{documentName}/swagger.json"); + IEndpointConventionBuilder openApi = app.MapOpenApi("/swagger/{documentName}/swagger.json"); + + if (ASF.GlobalConfig?.OptimizationMode != GlobalConfig.EOptimizationMode.MinMemoryUsage) { + openApi.CacheOutput(); + } // Add support for swagger UI, this should be after swagger, obviously app.MapScalarApiReference(