简体   繁体   English

仅为某些路径设置RAMMFAR

[英]Set up RAMMFAR for certain paths only

I have an ASP.NET 4.5 MVC app. 我有一个ASP.NET 4.5 MVC应用程序。 I don't want to set RAMMFAR ( runAllManagedModulesForAllRequests ) because that would needlessly send requests for static resources through the ASP.NET pipeline; 我不想设置RAMMFAR( runAllManagedModulesForAllRequests ),因为这会通过ASP.NET管道不必要地发送静态资源请求; however I do want all requests which begin with the path /Download/ to run through the ASP.NET routing pipeline, regardless of extension. 但是我确实希望所有以path /Download/开头的请求都通过ASP.NET路由管道运行,而不管扩展名如何。 This way I can route them to a Controller and serve dynamically generated resources. 这样我就可以将它们路由到Controller并提供动态生成的资源。

How can this be done? 如何才能做到这一点? I do not have access to IIS settings but hopefully there is a way to do this through web.config . 我无法访问IIS设置,但希望有一种方法可以通过web.config执行此操作。

The RAMMFAR setting is per application. RAMMFAR设置是每个应用程序。 You'd have to create a separate IIS applications if you want different parts of the site to have different settings, but unfortunately you state this is not an option for you. 如果您希望站点的不同部分具有不同的设置,则必须创建单独的IIS应用程序,但不幸的是,您声明这不适合您。

I two have two side notes though: 我两个有两个旁注:

  1. Are you sure you even need RAMMFAR? 你确定你甚至需要RAMMFAR吗? I think that when using IIS 7.5 and newer it's very rarely needed because IIS and ASP.NET can pretty much handle managed/native requests correctly. 我认为当使用IIS 7.5和更新版本时,它很少需要,因为IIS和ASP.NET几乎可以正确处理托管/本机请求。
  2. Have you identified this as an actual problem to always have it enabled? 您是否已将此识别为始终启用它的实际问题? Undoubtedly RAMMFAR will make things slower, but the question is whether it's causing a measurable effect in your app. 毫无疑问,RAMMFAR会使事情变得更慢,但问题是它是否会在您的应用中产生可衡量的影响。 Even if a static file does go through some managed code, the final processing of the file is handled back in native code. 即使静态文件通过某些托管代码,文件的最终处理也会以本机代码的形式处理。 So there's a bit of extra work to go "through" the ASP.NET managed pipeline, but once that's done it's back to native IIS/Windows code. 因此,有一些额外的工作可以“通过”ASP.NET托管管道,但是一旦完成它就会回到本机IIS / Windows代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 设置RAMMFAR时,为什么IIS 7在Web窗体回发中使用重写的URL(Helicon)剥离请求参数? - Why does IIS 7 strip request parameters on Web Forms postback with rewritten urls (Helicon) when RAMMFAR is set? HttpModule的性能是否与RAMMFAR一样差? - Does an HttpModule perform as badly as RAMMFAR? IIS可以设置为阻止超过特定限制的API响应吗? - Can IIS be set up to block API Responses over a certain limit? 设置httpmodule以防止某些页面出现404 - set up httpmodule to prevent 404's for certain pages 确保类库中的属性安全,并且仅需使用某种方法即可对其进行设置 - Securing property in a class library and requiring a only a certain method to set it ELMAH:您可以将其设置为仅远程发送电子邮件错误吗? - ELMAH: Can you set it up to email errors only remotely? MVC 在不使用 RAMMFAR 的情况下为带有文件扩展名的 url 捕获 404 错误 - MVC Catch 404 errors for urls with file extensions without using RAMMFAR 按下“编辑链接”按钮后,仅某些列可以更新,其余列设置为null - After Edit Linkbutton is pressed only certain columns can be Updated with the rest set to null 一定的BlockUI <div> 只要 - BlockUI for a certain <div> only 当 JQUERY ajax async 仅在 IE 中设置为 false 时,覆盖不显示 - Overlay does'nt show up when JQUERY ajax async set to false only in IE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM