properly respond to IfModifiedSince headers. should improve caching

This commit is contained in:
kay.one 2013-08-10 12:58:30 -07:00
parent d339d1208f
commit 00c32cbb35
2 changed files with 13 additions and 2 deletions

View file

@ -48,6 +48,13 @@ namespace NzbDrone.Api.Frontend
return null;
}
if (context.Request.Headers.IfModifiedSince.HasValue)
{
var response = new Response { ContentType = MimeTypes.GetMimeType(path), StatusCode = HttpStatusCode.NotModified };
_addCacheHeaders.ToResponse(context.Request, response);
return response;
}
var mapper = _requestMappers.SingleOrDefault(m => m.CanHandle(path));
if (mapper != null)