Skip to content

[Performance] Audit static asset volume and exclude rarely-used assets from MapStaticAssets manifest (serve via UseStaticFiles) #14

@VancouverBen

Description

@VancouverBen

Summary

Audit the static asset set for the Store app and reduce runtime overhead by:

  • bundling where appropriate, and/or
  • excluding large/rarely-hit directories from the MapStaticAssets manifest using StaticWebAssetEndpointExclusionPattern, then serving those excluded assets via UseStaticFiles.

Why

Microsoft Learn notes that MapStaticAssets loads build-time metadata eagerly to enable compression/caching/fingerprinting, which increases memory usage. For ~1,000+ assets or large infrequently accessed collections, bundling or combining MapStaticAssets (critical assets) + UseStaticFiles (excluded assets) can be a better tradeoff.

Guidance (docs)

Acceptance criteria

  • Identify candidate directories (e.g., icon/legacy image libraries) that are rarely used.
  • Update .csproj with StaticWebAssetEndpointExclusionPattern (preserving $(StaticWebAssetEndpointExclusionPattern)), if needed.
  • Ensure excluded assets are still served via UseStaticFiles and remain accessible.
  • Verify caching behavior in Production remains correct for both sets of assets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions