net10.0
Web layer for Koan Media: upload endpoints, variant routing, and storage-backed streaming helpers for media entities.
Published
Jun 12, 2026
4mo ago
Total Downloads
3.9K
3,941
Install
dotnet add package Sylin.Koan.Media.Web --version 0.17.0
| Product | Versions |
|---|---|
| .NET |
README
Koan.Media.Web
Generic media bytes controller for ASP.NET Core with correct HTTP semantics: HEAD/GET, Range (206/416), conditional requests (ETag/If-None-Match and If-Modified-Since), and configurable Cache-Control.
Capabilities
- Attribute-routed controller base: MediaContentController
- Full and ranged reads over StorageEntity
- Caching headers: ETag, Last-Modified; Accept-Ranges and Content-Range
- Cache-Control via options (MediaContentOptions)
Minimal setup
- Inherit for your entity:
public sealed class MediaController : MediaContentController<ProfileMedia> { }
- Optional: configure Cache-Control
services.Configure<MediaContentOptions>(o =>
{
o.EnableCacheControl = true; // default true
o.Public = true; // default true
o.MaxAge = TimeSpan.FromHours(1);
});
Notes
- Content type is inferred from stat.ContentType or file extension.
- ETag emission depends on provider support (Local emits a lightweight ETag derived from last-write time and length).
- Prefer thin controllers; keep I/O in models via StorageEntity statics.
Changes from Previous Version
No structural changes between v0.8.0 and v0.17.0.
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Compatibility metadata lists 1 target framework; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.