diff --git a/protocols/identify/src/behaviour.rs b/protocols/identify/src/behaviour.rs index aa818f4e61f..f51c4de5295 100644 --- a/protocols/identify/src/behaviour.rs +++ b/protocols/identify/src/behaviour.rs @@ -199,6 +199,11 @@ impl Config { /// /// If set to [`None`], caching is disabled. pub fn with_cache_config(mut self, cache_config: Option) -> Self { + #[allow(deprecated)] + { + // set cache_size to 0 to ensure if user call `with_cache_config(None)`, caching do get disabled. + self.cache_size = 0; + } self.cache_config = cache_config; self }