mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Added cache headers to static resources.
This commit is contained in:
parent
e21a0bd231
commit
b56da336c0
5 changed files with 73 additions and 8 deletions
|
@ -5,6 +5,7 @@ using NLog;
|
|||
using Nancy;
|
||||
using Nancy.Responses;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Api.Extensions;
|
||||
|
||||
namespace NzbDrone.Api.Frontend
|
||||
{
|
||||
|
@ -43,7 +44,10 @@ namespace NzbDrone.Api.Frontend
|
|||
|
||||
if (_diskProvider.FileExists(filePath))
|
||||
{
|
||||
return new StreamResponse(() => File.OpenRead(filePath), MimeTypes.GetMimeType(filePath));
|
||||
var response = new StreamResponse(() => File.OpenRead(filePath), MimeTypes.GetMimeType(filePath));
|
||||
response.Headers.EnableCache();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
_logger.Warn("File {0} not found", filePath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue