Hi all,
Can somebody tell me how Cuyahoga handles Caching??
The only way I can see how this is done is by specifying a time limit. Is there another way of doing this?? I would like to Cache and be able to specify a Cache dependency that will invalidate the cache.
Is this possible.
Paul
Cuyahoga has two levels of caching:
1. Caching of objects
The entire object tree of sites-nodes-sections-permissions is cached via the NHibernate second level cache (we used to have our own caching mechanism but that didn't work too well). The timeout (in seconds) is set via the web.config and editing a node or section clears this cache.
2. Output caching of modules
This is configurable per section (time in minutes). Here the module output (html) is cached, even with varying pathinfo parameters for modules. When a user is logged-in, the output cache is not used because it makes personalization very tricky.
Can you describe how you'd like to be able to specify a cache dependency?
Hi,
I would like the caching invalidated the moment I update the module. In .NET 2.0 you can have table cache dependencies i think.
With out publishing the pages I am not sure how to approach this problem.
Thanks for taking the time to answer
Paul
Thanks for explaining. The best solution in my opinion would be that the module raises an event that a content update has occured. The event handler can then take action. This looks simple at first, but it is complicated by the fact that the output cache also caches different views of a module. Let's take the Articles module as an example: here the list of articles is cached, but also the individual article views.
In my experience, the current solution works pretty well when you set the cache duration to a fairly low value (this site caches content for 30 seconds). This already can reduce the database load greatly.
About the table cache dependency in .NET 2.0: I believe you need SQL Server for that, and since we support multiple databases, I don't think this is really an option.
Hi - I was just interested in a further clarification on site caching. Based on what you mention below, my understanding is that the global cache, controlled in the web.config, only relates to the site structure, and that the caching of the content in the modules themselves is controlled through the module settings screen on an individual module level. Is this correct? The module cache defaults to "0" and that is where I left it as built out my site. Does "0" mean no caching is being applied to the content?
Is there any way to globally configure the cache level for modules? For example, in my development environment, I would want to disable the cache. But when I deploy to production, I want to turn it on. Will I have to go through each of my two dozen or so modules and configure it for each of them?
Thanks so much for the advice.
Regards, Lev
lmtsypinHi - I was just interested in a further clarification on site caching. Based on what you mention below, my understanding is that the global cache, controlled in the web.config, only relates to the site structure, and that the caching of the content in the modules themselves is controlled through the module settings screen on an individual module level. Is this correct? The module cache defaults to "0" and that is where I left it as built out my site. Does "0" mean no caching is being applied to the content?
Yes, this is correct.
Is there any way to globally configure the cache level for modules? For example, in my development environment, I would want to disable the cache. But when I deploy to production, I want to turn it on. Will I have to go through each of my two dozen or so modules and configure it for each of them?
At this moment there is no global cache level for module output, but it won't be too hard to implement it. Think about a global setting that only applies when the output cache duration is set to 0. But this might cause issues when you specifically don't want to cache a certain module. Ideas?
At this moment there is no global cache level for module output, but it won't be too hard to implement it. Think about a global setting that only applies when the output cache duration is set to 0. But this might cause issues when you specifically don't want to cache a certain module. Ideas?
2 options come to mind:
1) default to NULL/nothing and apply the global cache settings in this case, override with a local value if provided.
2) add a bool setting to each module, something like inherit global cache settings, and default to checked. If unchecked, then the local cache field becomes available and is used.
2 is probably better, but sounds like more work. Martijn, if you can provide with some pointers on how to implement option 1, like where the cache is set in the code for modules and how to access the global cache settings, than I take a stab at a patch.
Lev