Caching, Performance

Topics: Core, Customizing Orchard, General, Writing modules, Writing themes
Apr 5, 2014 at 6:45 AM
My situation:
1. I have several Orchard tenant.
2. I have some module such as Revolution Slider that has several content items in 3 levels (slider, slide, layer). Every slider has some slide and every slide has several layers. This module uses Record and Part and several content field (in Migration file). Therefore, there is several queries for creating slider widget shape for any request for the Page which contains Slider widget.
3. I'm developing some themes with some settings that must be isolated per tenants. My theme has some settings such as ForeColor, BackColor, Font, CustomCss and some other settings. My theme uses a table with repository (without Record, Part and Content Type, ...)

My Problem:
I cannot make a decision how to reach best performance.
1. I don't want to contact database for any request to fetch Slider items and theme settings.
But what is correct way about my module and my theme to decrease number of queries in any requests?
2. I need filter and sort for Revolution Slider module. Therefore i cannot remove Record. (Correct?) What is benefits of using Infoset instead of old content field (in Migration)?
3. Can i use Infoset for storing theme setting instead of Table? If i create Part while i have no Content type for theme settings, How can i use that part? If i use general Site Settings Type, large amount of CustomCss will appear in site setting record and i cannot delete it after disabling theme. Also note that my system has several themes.
4. Can i use cache manager for CustomCss and other properties or for Slider Shape? Or i must use physical file for caching CustomCss? What is best approach?
5. What is default storage for ICacheManager? If it uses RAM, I am worry about storing large data in cache. Also is ICacheManager isolated per tenant?
Apr 5, 2014 at 5:07 PM
Don't try to cache the content if it's for display. Instead enable the Output Cache module. Unless you main usage is with authenticated users, but usually it's not.

For your theme's settings, you should use ICacheManager. It's in memory but the amount it will take is so ridiculous you should not be concerned about it.

If you edit your tenants you will find a checkbox to define which tenant can access which themes. It's new in 1.7.3 and 1.8.