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.