Skip to content

Reduce size of Swashbuckle.AspNetCore.SwaggerUI.dll #1646

@vitalybibikov

Description

@vitalybibikov

Hi, I'm using SwaggerUI with Azure Functions.
So size is quite critical to reduce cold start time.

Currently, the whole app is about 13mbs, after using R2R latest feature of 3.1 core.
And SwaggerUi is around 1.7mb solely.

I'm suggesting to reduce SwaggerUI.dll size by compressing EmbeddedResources

  <ItemGroup>
    <EmbeddedResource Include="index.html" />
    <EmbeddedResource Include="node_modules/swagger-ui-dist/**/*" Exclude="**/*/*.map;**/*/*.json;**/*/*.md" />
  </ItemGroup>

For instance, usage of simple zip will reduce size by around 300%.

Example: https://github.com/vitalybibikov/azure-functions-extensions-swashbuckle/tree/dev/src/AzureFunctions.Extensions.Swashbuckle/AzureFunctions.Extensions.Swashbuckle/EmbededResources

Metadata

Metadata

Labels

p2Medium priority

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions