Content Item Cache (Widegt Cache)

Topics: Core, Customizing Orchard
Oct 28, 2014 at 2:36 PM

simply I want a mechanism to cache only some parts of my site pages not the hole pages as Outputcache module do, like some widgets which don't updated frequently.

but what I'm trying to do is to create a new part named (CachePart), and attach it to some contentItem like menu widget, then when render this part it will render the cached version of this content item only, without call the driver of the parts within the content item.

Thank you.
Nov 10, 2014 at 1:47 AM
You're in luck - I just pushed a changeset to the IDeliverable.Widgets repository that implements exactly that. You can download the module from our git repository: (notice it is in the develop branch, not the master branch).

To use this feature, do the following:
  1. Download and copy the module to the Modules folder.
  2. Enable the Widget Output Cache feature. This will add the OutputCachePart to the system.
  3. Go to Content Type Definition and edit the widget type you'd like to attach the OutputCachePart, for example Menu Widget, and attach that part.
  4. Go to Widgets and edit the widgets you wish to enable output caching for. You'll see a checkbox labeled "Enable Output Cache ".
  5. Done.
Note that the cache key is computed based on the current route. So if you for example have a menu widget with many items, the selected path is properly maintained.