code: func (user *User) SetCache(key string, val interface{}, ttl time.Duration) error {
  	expiresAt := time.Now().Add(ttl)
  
  	serviceID := user.ctx.getServiceID()
  	key = strings.ToLower(key)
  
  	if val == nil {
  		err := user.ctx.db.C("users_cache").Remove(bson.M{"userid": user.ID, "service": serviceID, "key": key})
  		return err
  	}
  	_, err := user.ctx.db.C("users_cache").Upsert(bson.M{"userid": user.ID, "service": serviceID, "key": key}, bson.M{"$set": bson.M{"val": val, "expiresat": expiresAt}})
  	if err != nil {
  		// workaround for WiredTiger bug: https://jira.mongodb.org/browse/SERVER-14322
  		if mgo.IsDup(err) {
  			return user.ctx.db.C("users_cache").Update(bson.M{"userid": user.ID, "service": serviceID, "key": key}, bson.M{"$set": bson.M{"val": val, "expiresat": expiresAt}})
  		}
  		log.WithError(err).WithField("key", key).Error("Can't set user cache value")
  	}
  	return err
  }
docs: // SetCache set the User's cache with specific key and TTL