如何使 StaticFile 处理程序仅服务实际存在的文件并使其他人转到 asp.net mvc 管道或自定义 http 处理程序。
1) GET /images/file.jpg
exists => serve it (StaticFile handler / as efficiently as possible)
2) GET /images/file_640x480.jpg
1. request (doesn't exist)
* load file.jpg
* resize
* save as file_640x480.jpg
=> serve from memory
following requests
=> should use 1) because the file is now there
这很简单,<modules runAllManagedModulesForAllRequests="true" />
但我想这更像是一种解决方法,而不是真正的解决方案。