Actually I am trying to do some caching strategy but finding it difficult. Here is the full code it's works but if cache expire after some time I still want value from db and then hit the network as well but if I return error in flatmap then I'll not get value from db first however network call work