【发布时间】:2012-11-24 13:31:01
【问题描述】:
如何让 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" /> 很简单
但我想这与其说是真正的解决方案,不如说是一种解决方法。
【问题讨论】:
标签: asp.net asp.net-mvc iis httphandler