public void Invalidate(ICacheInvalidationKey dependency) { var topic = TransformDependency(dependency); try { pubSub.Publish(topic, filter.InstanceKey); } catch (Exception e) { AppInfo appInfo = null; try { appInfo = AppInfo.GetAppInfo(); } catch { } Log.ErrorLog.LogApplicationError(new InvalidOperationException("Error invalidating cache. Check the Cache Invalidation Service status in the Environment Health page.", e), appInfo?.OsContext, "Server Side Cache"); } finally { // Sending a message to invalidate local cache, without sending to RabbitMQ Server // This way, current application will immediatly see its cache invalidated filter.OnMessageReceived(new PubSubMessage(topic, "local Invalidation")); } }
protected override string TransformDependency(ICacheInvalidationKey key) { return(key.GetKeyAsString() + RuntimePlatformUtils.CACHE_CONTROL_FILE_EXT); }
protected virtual string TransformDependency(ICacheInvalidationKey key) { return(key.GetKeyAsString()); }