How to prevent ASP.NET and Kentico from processing

2019-05-08 07:00发布

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?

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

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

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: 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.

2条回答
劫难
2楼-- · 2019-05-08 07:23

If the files are placed directly on the file system (and are not used within Media library in Kentico CMS) the Kentico CMS is not handling those files. Anyway, if you want to have better performance maybe you should consider adding them through the CMS interface - so they will be handled by the CMS engine and you can use the caching options available in Kentico CMS to improve the performance. Loading the files always, every time from the disk might not be always the fastest way how to retrieve them.

查看更多
时光不老,我们不散
3楼-- · 2019-05-08 07:42

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).

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.

查看更多
登录 后发表回答