Stored files
Images, video and downloads are served by the same routes as pages. Make their URLs with GetUrl:
@inject RelatudeCmsContext Ctx
<img src="@Ctx.GetUrl(Model.Picture)" alt="">
<img src="@Ctx.GetUrl(Model.Picture, new FileAdjustmentImage { Width = 400 })" alt="">
<video src="@Ctx.GetUrl(Model.Film)" controls></video>- Variants, such as a resized image or a converted video, are made the first time they are requested.
- Range requests get
206 Partial Content, which video and audio players need to seek. This works for files on local disk. A file on blob storage is sent whole. - Caching. A file or a finished variant may be cached for 30 days. Its URL changes when the file does.
- Read access. A file of a page the visitor may not read gets the same answer as the page.