This project is read-only.

About Cache

Topics: Administration, Customizing Orchard, General
Nov 7, 2011 at 4:57 AM


I added my own widget and this widget added to right block(aside second) of site.When any page opening, this widget runing, too. In this widget I'm getting data from other site.When getting data the page opening for a long time And I want to cache this data (ex:for 2 hours).How can I do it?

Any help appreciated!

Nov 7, 2011 at 12:07 PM

Have a look at this tutorial:

Or look into this widget: Probably this is more straightforward if you want caching for a specified amount of time.

Nov 7, 2011 at 5:35 PM

Just as information, in the current work I am doing for the Cache module, this will be done. You will be able to attach a Cache Part to a content type to handle how it's items are cached. And then be able to do donut caching, which would also work with reverse proxy caching (nginx, varnish).

Nov 7, 2011 at 5:58 PM

Sounds great, Sebastien - unfortunately I had to stop using your Cache module for the time being because certain parts of my display are dynamic by requirement. A more flexible solution sounds like I could use it again!

Nov 9, 2011 at 6:40 AM

Thanks to all!


Nov 9, 2011 at 6:51 AM
Edited Nov 9, 2011 at 6:54 AM

I solved my problem:

var timeToCache = 30; // will be configurable


_cacheManager.Get("CacheKey", ctx => 






// Operations ...