code: func (cs cachedStore) Set(key, value string) error {
  	// check if record already exists
  	ctx := context.Background()
  	dk := datastore.NewKey(ctx, "camnetdns", key, 0, nil)
  	var oldValue dsValue
  	if err := cs.dsClient.Get(ctx, dk, &oldValue); err != nil {
  		if err != datastore.ErrNoSuchEntity {
  			return fmt.Errorf("error checking if record exists for %q from datastore: %v", key, err)
  		}
  		// record does not exist, write it.
  		return cs.put(ctx, key, value)
  	}
  	// record already exists
  	if oldValue.Record != value {
  		// new record is different, overwrite old one.
  		return cs.put(ctx, key, value)
  	}
  	// record is the same as before
  	if oldValue.Updated.Add(staleRecord).After(time.Now()) {
  		// record is still fresh, nothing to do.
  		return nil
  	}
  	// record is older than 30 days, so we rewrite it, for analytics.
  	return cs.put(ctx, key, value)
  }
docs: // Set writes the key, value pair to cs. But it does not actually write if the
  // value already exists, is up to date, and is more recent than 30 days.