如何防止ASP.NET和Kentico处理静态文件 [英] How to prevent ASP.NET and Kentico from processing static files

查看:101
本文介绍了如何防止ASP.NET和Kentico处理静态文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Kentico CMS网站,该网站正在处理诸如png文件之类的静态资源.我希望ASP.NET不处理这些文件.我该怎么做?

I have a Kentico CMS website that is processing static resources, such as png files. I would like these files to not be processed by ASP.NET. How do I do this?

我正在使用Kentico CMS(Web窗体)运行IIS 7.5和ASP.NET 3.5.应用程序池为集成模式

I am running IIS 7.5 and ASP.NET 3.5 with Kentico CMS (Web Forms). App Pool is integrated mode

我查看了Web配置文件中的<location>元素,但似乎实现它没有什么作用.

I looked at the <location> element in the web config file but it seemed implementing it didn't make a difference.

更新:图像包含在名为/res的文件夹中,该文件夹是webroot文件夹的子级.即不受kentico,媒体库等管理.通过Visual Studio添加.

Update: the images are contained within a folder named /res, a child of the webroot folder. i.e. not managed by kentico, the media library etc. Added via Visual Studio.

edit:潜在的问题是我的主页上有很多图像,有时需要很长时间才能加载.有时,静态图像可能需要一整分钟才能加载(这使我们的警报望而却步).我不确定100%导致此问题的原因,这是解决问题的步骤.

edit: The underlying problem is my homepage has numerous images on it that are sometimes taking a long time to load. on occasions, static images can take a full minute to load (tripping our alarming). I'm not 100% sure what is causing this problem and this is a step in troubleshooting.

推荐答案

集成模式表示

Integrated mode means that all requests will participate in the ASP.NET pipeline. I believe that ultimate handler for static resources would be static file handler from IIS but before serving those files, you will see ASP.NET modules and application events getting triggered for the same (including authentication).

也许,您应该详细说明ASP.NET&这些文件.通常,您可以为特定路径关闭ASP.NET模块.
当您将这些文件放在子文件夹中时,另一种解决方法是将子文件夹设置为不同的应用程序,并以经典模式在不同的应用程序池中提供这些文件.

Perhaps, you should elaborate the problem that you faced w.r.t ASP.NET & these files. Typically, you can turn off ASP.NET modules for particular path(s).
As you have these files in a sub-folder, another work-around could be to make the subfolder as different application and serve these files in a different app-pool in classic mode.

这篇关于如何防止ASP.NET和Kentico处理静态文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆