diff --git a/redis/redis.go b/redis/redis.go
index ff44a4bd1a0b3e5e4de01e21f0bb82cbe4c6cfb5..1f8545ee421b870cd4ff21998be63e307cd31380 100644
--- a/redis/redis.go
+++ b/redis/redis.go
@@ -91,6 +91,28 @@ func (r ClientWithHelpers) SetObjectByKey(key string, object interface{}) {
 	}
 }
 
+func (r ClientWithHelpers) SetObjectByKeyWithExpiry(key string, object interface{}, expiration time.Duration) {
+	if !r.IsConnected() {
+		return
+	}
+
+	jsonBytes, err := json.Marshal(object)
+	if err != nil {
+		logs.ErrorWithMsg("Error marshalling object to Redis: %s", err)
+		return
+	}
+
+	_, err = r.Client.Set(ctx, key, string(jsonBytes), expiration).Result()
+	if err != nil {
+		logs.ErrorWithMsg(fmt.Sprintf("Error setting value to Redis for key: %s", key), err)
+
+		/* Prevent further calls in this execution from trying to connect and also timeout */
+		if strings.HasSuffix(err.Error(), "i/o timeout") {
+			r.Available = false
+		}
+	}
+}
+
 func (r ClientWithHelpers) SetObjectByKeyIndefinitely(key string, object interface{}) {
 	if !r.IsConnected() {
 		return