We have a bunch of sites most are umbraco v6 and one is v4.9. Each site has a cms url site and the other is the live front end site. Both share same database. Content editing is done on cms site only, front end site does not even have umbraco access.
When you publish nodes etc on cms site distributed publish calls are made to front end site so all content is up to date. One issue is when we update dicitonary items on cms site they are not reflected on the front end site. To get them to appear we have recycle app pool. Is there a way to update / clear dictionary cache on front end server?
Don't suppose you know where in the source and how it does the add of dictionary items to cache and removes them? I got a bit of a dirty hack but need to see how its added and removed from cache?
but in older Umbraco versions, I've tapped into the
LocalizationService.SavedDictionaryItem
LocalizationService.DeletedDictionaryItem
events - and older still
Dictionary.DictionaryItem.Saving - (fires for each translation)
Dictionary.DictionaryItem.Deleting
to trigger either ICacheRefresher or DB entry (see Moriyama.Cloud on github) and then when that executes on the 'other' servers, I then - (warning horrible hack) - Create a dictionary item called 'TempCacheRefresh' if it doesn't exist, and then update it if it does - the act of updating or creating this 'dummy' dictionary item on the 'other' server clears all of the Dictionary Item Cache for any updated items.
Update dictionary cache on distributed server
We have a bunch of sites most are umbraco v6 and one is v4.9. Each site has a cms url site and the other is the live front end site. Both share same database. Content editing is done on cms site only, front end site does not even have umbraco access.
When you publish nodes etc on cms site distributed publish calls are made to front end site so all content is up to date. One issue is when we update dicitonary items on cms site they are not reflected on the front end site. To get them to appear we have recycle app pool. Is there a way to update / clear dictionary cache on front end server?
Regards
Ismail
Comment author was deleted
Good question as I'm curious myself. I was hoping to find a 'OnDistributedCall` event or something like that but found a 404 page instead.
https://our.umbraco.org/Documentation/Reference/Events/index/Document-Events
My hope was you could tie into that event.
Kevin,
Don't suppose you know where in the source and how it does the add of dictionary items to cache and removes them? I got a bit of a dirty hack but need to see how its added and removed from cache?
Regards
Ismail
Comment author was deleted
I do not sorry.
Comment author was deleted
If you are still on v4 check out the method umbraco.presentation.cache.dispatcher.Refresh(factoryGuid, id);
Tim,
Cheers will take a look at this.
Regards
Ismail
Tim,
I have had a bit of a sniff around the code base and the dictionary items are cached in memory in hashtable
And hash table is updated when you add / remove / update dictionary items.
So I do not think what I want to do is doable.
Regards
Ismail
Hey Ismail,
I think there is stuff coming in 7.3 so that you can call:
ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheObjectTypes<IDictionaryItem>();
but in older Umbraco versions, I've tapped into the
events - and older still
to trigger either ICacheRefresher or DB entry (see Moriyama.Cloud on github) and then when that executes on the 'other' servers, I then - (warning horrible hack) - Create a dictionary item called 'TempCacheRefresh' if it doesn't exist, and then update it if it does - the act of updating or creating this 'dummy' dictionary item on the 'other' server clears all of the Dictionary Item Cache for any updated items.
regards
Marc
Marc,
You got link for the moriyama.cloud on github i cannot find it.
Regards
Ismail
Hey Ismail,
I've added the dictionary stuff to a fork here:
https://github.com/marcemarc/cloud-umbraco-cache-refresh
but if your using the more typical distributed calls Webservices in a load balanced environment, you could create an ICacheRefresher:
https://our.umbraco.org/Documentation/Reference/Cache/cache-refresher
and do the sneaky dictionary item create/update in your custom Refresh method.
Triggering the ICacheRefresher when dictionary items change (above events fire).
is working on a reply...