How to prevent ASP.NET and Kentico from processing static files

穿精又带淫゛_ 提交于 2019-12-07 07:28:50

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/7961487/how-to-prevent-asp-net-and-kentico-from-processing-static-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!