c# - ASP.NET MVC and FileResult caching -


i have such simple code:

// cache disabled  [outputcache(nostore = true, duration = 0)] public async task<actionresult> getvideo(string path) {                 byte[] data = await _fileservice.getfileasync(path);                             if (data == null)         return httpnotfound();      return file(data, "video/mp4"); } 

this code simple: retrieves file's content byte array , sends client. have web page contains video tags. of tags use getvideo source. each video 400-500 mb. after page ready w3wp.exe in task manager takes 3-4 gb ram , doesn't release memory. wrote disable resutl caching outputcacheattribute. problem doesn't hide in method getfileasync because when replace line

byte[] data = await _fileservice.getfileasync(path);       

with line

byte[] data = system.io.file.readallbytes(server.mappath(path)); 

this problem still exists. maybe knows how release memory after sending bytes client?


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -