4

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.

Rob Gray
  • 3,186
  • 4
  • 33
  • 34
  • Are the images uploaded through Kentico (added as content through CMSDesk or imported into a Media library), or just in the directory that Kentico is running in? – Doozer Blake Nov 01 '11 at 01:18

2 Answers2

3

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.

VinayC
  • 47,395
  • 5
  • 59
  • 72
  • Thanks. I was aware that all the requests go through asp.net in integrated mode. I just don't know enough about it to know how to stop these files from being processed. I read something about using the element in the web.config but I don't know how to test that that work. I've editted the question with the underlying problem. Thanks:) – Rob Gray Nov 01 '11 at 04:25
  • @rob_g, probably, your request might be getting queued up. Use tool such as fiddler to check this. Does serving those files in classic mode solves your problem? If yes, you can try clearing all modules for the said path (or you can put a separate config file in the sub-folder). Session state module can queue up the requests but it shouldn't come into the action for static resources - clearing all modules should take out such possibilities. – VinayC Nov 01 '11 at 04:48
  • thanks VinayC. I've just used pingdom to analyse the page and certainly it's recommended I need to parallelise image requests. Something I'd considered early. I'm going to go in that direction for now. Thanks – Rob Gray Nov 01 '11 at 04:50
  • Thank @VinayC, I had a similar issue with Sitecore and a static files subfolder and your solution of converting the subfolder to an application and running classic mode worked for me! – Jay S Dec 24 '14 at 16:16
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.

Jurajo
  • 21
  • 1