The question is - what is an effective way to deliver files to users? Consider an asp.net application which gives an ability to view various files. A kind of image library or web file directory. Key points are:user can upload arbitrary files of size <= 10Mbfiles are stored on diskfiles never changeuser can remove a filethere is a certain access check procedure for accessing a fileSo I'd need to find some balance between availability (i.e. caching) and security (i.e. access control).Currently user issues a request in a form /attachment/{id}, and a controller reads a file from a disk and sends it to a client:if(HasAccess(user)) {   var data = File.ReadAllBytes()   return new FileResult(data);}I suspect that's not an optimal way: it involves asp.net application pipeline and uses disks a lot. Can be this way optimized? Can I store such files in Output cache? Are there other ways (not using Controller) to deliver files which should be considered?
Delivering and caching files in asp.net
asp.net;caching;iis