mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Setting no cache values to video files
This commit is contained in:
parent
50aaeff7da
commit
1bb2b27edc
@ -5,13 +5,14 @@ using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
|
||||
namespace Kyoo.Api
|
||||
{
|
||||
[Route("video")]
|
||||
[ApiController]
|
||||
public class VideoApi : ControllerBase
|
||||
public class VideoApi : Controller
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly ITranscoder _transcoder;
|
||||
@ -27,6 +28,14 @@ namespace Kyoo.Api
|
||||
_transcodePath = config.GetValue<string>("transcodeTempPath");
|
||||
}
|
||||
|
||||
public override void OnActionExecuted(ActionExecutedContext ctx)
|
||||
{
|
||||
base.OnActionExecuted(ctx);
|
||||
ctx.HttpContext.Response.Headers.Add("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||
ctx.HttpContext.Response.Headers.Add("Pragma", "no-cache");
|
||||
ctx.HttpContext.Response.Headers.Add("Expires", "0");
|
||||
}
|
||||
|
||||
private string _GetContentType(string path)
|
||||
{
|
||||
if (_provider == null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user