Umbraco 7 – Fix The Tagging Cache

This is a quickie but recently I was working on an Umbraco 7 build and had an issue with the inbuilt Tagging system. The issue was if I added a tag to one page and moved to another my my new tags were not appearing in the dropdown list.

After reflecting on the DLLs, watching the service /umbraco/backoffice/UmbracoApi/TagsData/GetTags?tagGroup=default I could see the tags SHOULD be coming through. Then I found the issue, turns out that the Angular for this area was using a 5 minute cache.  To fix navigate to umbraco/js/umbraco.controller.js and around line 6035 find the code.

prefetch: {
url: umbRequestHelper.getApiUrl(“tagsDataBaseUrl”, “GetTags”, [{ tagGroup: $scope.model.config.group }]),
//TTL = 5 minutes
ttl: 300000,
filter: dataTransform
},

Then change the ttl value from 300000 to 0 and this will fix the issue. This will simply turn caching off but I’ve not seen any issues with this.

About ScottReed

I am an ASP.NET C# developer working in the south of England current for the south's top digital agency Redweb. I have worked for financial companies, CMS vendors, charities and web agencies tacking a variety of challenges. As part of my jobs and freelance I have done lots of work for high profile companies, big brands and government bodies and worked on some exciting large award winning builds. I love development and enjoy architectural design of software. ScottGu is my .NET hero and the Guru of all thing M$oft