Both servers are registered in the umbracoServer table server correctly and the umbracoApplicationUrl is set to the primary domain for the site in the umbracoSettings.config file.
Changes are published on Server 1 fine and the PageCacheRefresher.CacheUpdated event is fired on the master. The cache instructions in the database are processed by the slave server but the PageCacheRefresher.CacheUpdated event does not appear to fire on the slave server yet the lastsync value is updated and so is the umbraco.config cache file.
Thanks Dave, that's really useful to have some context relating to the change in behaviour and it turns out it addresses another unresolved issue I kept seeing in regards to "DISTRIBUTED CACHE NOT UPDATED" errors in the logs in previous versions.
Maybe you can create a fake umbraco context if you need it.
I think in actual fact I can remove the check now as it is already redundant based on the issue you have referenced.
Load Balanced Site - PageCacheRefresher.CacheUpdated Does Not Seem to Fire on Slave Server
I have a large multi-site install load balanced using a Flexible Load Balancing setup.
I am subscribing to the
PageCacheRefresher.CacheUpdated
event in theApplicationStarted
event of myApplicationEventHandler
as follows:Both servers are registered in the
umbracoServer
table server correctly and theumbracoApplicationUrl
is set to the primary domain for the site in the umbracoSettings.config file.Changes are published on Server 1 fine and the
PageCacheRefresher.CacheUpdated
event is fired on the master. The cache instructions in the database are processed by the slave server but thePageCacheRefresher.CacheUpdated
event does not appear to fire on the slave server yet the lastsync value is updated and so is the umbraco.config cache file.Any ideas what might cause that to happen?
Hi Simon,
What version are you running ? We noticed that in one of the latest versions UmbracoContext.Current is always null in the cache updated event.
Could you remove that line to check this and see if something is written to the log ?
Dave
Hi Dave
This site is running 7.10.4. I will see about removing that line this morning in the next deployment and let you know.
Thanks, Simon
You are indeed correct Dave -
UmbracoContext.Current == null
now on the slave server when the event is triggered so thanks for pointing that out.Hi Simon,
I noticed this as well. In earlier versions this was set.
This was a breaking change in 7.8.0 I know found out : https://issues.umbraco.org/issue/U4-10150
Maybe you can create a fake umbraco context if you need it.
Don't know if this gist is still working : https://gist.github.com/sniffdk/7600822
Make sure to read all the comments
Dave
Thanks Dave, that's really useful to have some context relating to the change in behaviour and it turns out it addresses another unresolved issue I kept seeing in regards to "DISTRIBUTED CACHE NOT UPDATED" errors in the logs in previous versions.
I think in actual fact I can remove the check now as it is already redundant based on the issue you have referenced.
Thanks for your help Dave, much appreciated.
is working on a reply...