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

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

I am running IIS 7.5 and ASP.NET 3.5 with Kentico CMS (Web Forms). App Pool - Integrated Mode

I looked at the <location> element in the web configuration file, but it seems that its implementation did not help.

Update: Images are contained in a folder named / res, a child of the webroot folder. those. not managed by kentico, media library, etc. Added through Visual Studio.

edit: The main problem is that my homepage has a lot of images, which sometimes take a lot of time to load. in some cases, static images can be loaded in a full minute (turning off our alarm). I am not 100% sure what causes this problem and this is a troubleshooting step.

+4
source share
2 answers

Integrated mode means that all requests will participate in the ASP.NET pipeline . I believe that the final handler of static resources will be a static file handler from IIS, but before serving these files, you will see that ASP.NET modules and application events are fired for the same thing (including authentication).

Perhaps you should develop the problem wrt ASP.NET and these files encountered. Typically, you can disable ASP.NET modules for specific paths (paths).
Since you have these files in a subfolder, another job might be to make the subfolder as another application and serve these files in another application in classic mode.

+3
source

If the files are located directly on the file system (and are not used in the Kentico CMS media library), Kentico CMS does not process these files. In any case, if you want better performance, perhaps you should consider adding them through the CMS interface, so they will be processed by the CMS engine, and you can use the caching options available in Kentico CMS to improve performance. Downloading files always, every time from a disk, may not always be the fastest way to extract them.

+2
source

Source: https://habr.com/ru/post/1379059/


All Articles