add caching support for folders

This commit is contained in:
sbwalker
2025-01-28 12:47:23 -05:00
parent a996a88fc4
commit 2a06304a2c
5 changed files with 63 additions and 11 deletions

View File

@ -257,6 +257,10 @@ namespace Oqtane.Pages
}
else
{
if (!string.IsNullOrEmpty(file.Folder.CacheControl))
{
HttpContext.Response.Headers.Append(HeaderNames.CacheControl, value: file.Folder.CacheControl);
}
HttpContext.Response.Headers.Append(HeaderNames.ETag, etag);
return PhysicalFile(filepath, MimeUtilities.GetMimeType(downloadName));
}