MapStaticAssets is a new feature that enhances the delivery of static assets in web applications. It is intended as a replacement for UseStaticFiles.
MapStaticAssets offers key advantages over UseStaticFiles
, including:
-
Build-time compression:
-
Uses gzip during development and gzip + Brotli during publish, minimizing asset sizes.
-
-
Content-based ETags:
-
Generates ETags from the SHA-256 hash of each file’s content, ensuring browsers only re-download files when their content changes
Read more here.
Cheers
Samitha