Adding cache to a module

Topics: Writing modules
Sep 26, 2013 at 3:45 PM
Hello!

I have been searching high and low for this, but can't seem to find the right answer.

I have been writing a module in Orchard together with some widgets that I use for it, and now I want to enable caching of the database queries in my classes.

Is there any documentation on how to add caching to my modules and widgets?
I've tried to just enable the Output cache and the syscache, but it seems that it only works for the modules that came with Orchard (I checked with SQL Server Profiler, and my queries are still being sent all the time to the database, while the normal Orchard queries for content and such, are not, and seems to be cached).
Coordinator
Sep 26, 2013 at 5:54 PM
There is nothing magical about the modules that came with Orchard. Syscache works with all modules that use the Orchard database. Output cache as well (but only for anonymous users).