Alfresco Share – refresh tagscope cache

Alfresco uses a concept called tagscope caching to support performant tagging services in Alfresco Share. Each folder representing a site or a site container (doclib, wiki…)  has a d:content property cm:tagScopeCache thats acts as a tag cache. More detailed this property is a txt-file that contains a list of tags & their quantity, e.g.:


Sometimes these tagScopeCache are out-of-sync (at least in Alfresco 3.1), so I wrote a simple Javascript snippet to refresh this caches:

function refreshTagScope(folder){
var refresh = actions.create("refresh-tagscope");
for each(item in folder.children)
if (item.isContainer)

Steps to use this script:

  1. Upload js to data dictionary / Scripts
  2. navigate in JSF client to site or site container where you want to refresh your tagScopeCache
  3. open details page of folder
  4. Run Action -> Execute Script & choose the uploaded script.

2 thoughts on “Alfresco Share – refresh tagscope cache

  1. Hi,

    thanks for this script, it’s really helpful.
    Is there a way to launch this kind of script from Alfresco Share code (in a webscript for instance) ?

  2. Hi Alfrescian:

    ¿ Can you tell me if there exist a jira for this ? I have the same issues in Alfresco 4.1.1 EE but I don’t know when it start to happen 🙂 Also in recent 4.2.c

    We have included this in Tag Cloud Dashlet Refresh (for doing an on demand resync). What do you think about a cron that executes javascript API over all sites ?

    Best wishes from Bilbao.


Leave a Reply

Your email address will not be published. Required fields are marked *