Added cache headers to static resources.

This commit is contained in:
Keivan Beigi 2013-06-28 12:19:40 -07:00
parent e21a0bd231
commit b56da336c0
5 changed files with 73 additions and 8 deletions

View file

@ -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);