Index: /quintagroup.dropdownmenu/trunk/README.txt
===================================================================
--- /quintagroup.dropdownmenu/trunk/README.txt	(revision 3346)
+++ /quintagroup.dropdownmenu/trunk/README.txt	(revision 3347)
@@ -4,4 +4,5 @@
 This package allows to build dropdown menu through the web with portal_actions.
 Submenus are built from a tree of nested Category Actions and Actions.
+
 The other strategy used to populate submenus is Plone default NavigationStrategy, 
 the one used in navigation portlet.  
@@ -37,4 +38,16 @@
      
 By default the root of dropdown menu is 'portal_tabs' category.
+
+Menu caching
+============
+
+If the menu built with Navigation strategy is entirely public it can be cached for
+all users. If Authenticaded users should see some non public items the menu can be
+cached for anonymous only.
+
+Caching in case of involving the portal_actions strategy is effective only in case
+if all the action are public and have no extra conditions. In case some conditions
+are applied per action switch off caching.
+
  
 Compatibility
@@ -51,3 +64,4 @@
 * install Plone DropDown Menu in Plone via Site Setup -> Add-ons
 
-Find more details inside docs/INSTALL.txt 
+Find more details on the topic inside docs/INSTALL.txt 
+
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py	(revision 3346)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py	(revision 3347)
@@ -26,5 +26,5 @@
     # menu cache key conssits of:
     # - selected item not only top tab
-    # - site can beaccessed on different domains 
+    # - site can be accessed on different domains
     # - language is important for multilingua sites
 
@@ -44,10 +44,12 @@
            path_key + \
            language + \
-           str(time() // (60 * 5))  
-
-# we are gcaching the menu structure built out of portal_actions tool
+           str(time() // (60 * 5))
+
+
+# we are caching the menu structure built out of portal_actions tool
 # this cache key does not take in account expressions and roles settings
 def tabs_cache_key(f, view, site_url):
     return site_url + str(time() // (60 * 60))
+
 
 def dropdowncache(f):
@@ -55,5 +57,5 @@
         portal_state = getMultiAdapter((view.context, view.request),
                                         name=u'plone_portal_state')
-        # it is impossible to reliably cache entire rendered menu generated  
+        # it is impossible to reliably cache entire rendered menu generated
         # with potral actions strategy.
         if not view.conf.enable_caching or view.conf.show_actions_tabs or \
@@ -65,8 +67,15 @@
 
 
+def tabscache(f):
+    def func(view, site_url):
+        if not view.conf.enable_caching:
+            return f(view, site_url)
+        return ram.cache(tabs_cache_key)(f)(view, site_url)
+    return func
+
+
 class GlobalSectionsViewlet(common.GlobalSectionsViewlet):
     index = ViewPageTemplateFile('templates/sections.pt')
     recurse = ViewPageTemplateFile('templates/sections_recurse.pt')
-
 
     def update(self):
@@ -143,5 +152,5 @@
         return res
 
-    @ram.cache(tabs_cache_key)
+    @tabscache
     def prepare_tabs(self, site_url):
         def normalize_actions(category, object, level, parent_url=None):
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/interfaces.py
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/interfaces.py	(revision 3346)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/interfaces.py	(revision 3347)
@@ -10,6 +10,7 @@
 cachings = SimpleVocabulary(
     [SimpleTerm(value=u'anonymous', title=_(u'Cache only for anonymous')),
-     SimpleTerm(value=u'all', title=_(u'Cache for all users')),]
+     SimpleTerm(value=u'all', title=_(u'Cache for all users')), ]
     )
+
 
 class IDropDownMenuLayer(IDefaultPloneLayer):
@@ -83,10 +84,10 @@
         default=u"_sub",
         required=False)
-    
+
     enable_caching = schema.Bool(
         title=_(u"Enable menu caching"),
         description=_(u"Caching of the menu viewlet improves page rendering "
                       u"speed."),
-        default=True        
+        default=True
         )
 
@@ -95,4 +96,4 @@
     description=_(u"Caching strategy defines how the cache key will be built."),
     default="anonymous",
-    vocabulary=cachings        
+    vocabulary=cachings
     )
