Skip to content

Commit f524865

Browse files
committed
Cache generated swagger.json by default
1 parent d17399d commit f524865

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ArchiSteamFarm/IPC/ArchiKestrel.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,11 @@ private static void ConfigureApp([SuppressMessage("ReSharper", "SuggestBaseTypeF
261261
app.MapControllers();
262262

263263
// Add support for OpenAPI, responsible for automatic API documentation generation, this should be on the end, once we're done with API
264-
app.MapOpenApi("/swagger/{documentName}/swagger.json");
264+
IEndpointConventionBuilder openApi = app.MapOpenApi("/swagger/{documentName}/swagger.json");
265+
266+
if (ASF.GlobalConfig?.OptimizationMode != GlobalConfig.EOptimizationMode.MinMemoryUsage) {
267+
openApi.CacheOutput();
268+
}
265269

266270
// Add support for swagger UI, this should be after swagger, obviously
267271
app.MapScalarApiReference(

0 commit comments

Comments
 (0)