Why this matters
LGPD requires limiting retention to the necessary period; caches often bypass normal data lifecycle.
All cache entries containing PII must set an explicit TTL aligned to the retention policy (e.g., 24h). No indefinite storage of personal data in Redis or in-memory caches.
LGPD requires limiting retention to the necessary period; caches often bypass normal data lifecycle.
Side-by-side examples engineers can pattern-match during review.
rdb.Set(ctx, key, json, 0) // no expirationttl := 24 * time.Hour\nrdb.Set(ctx, key, json, ttl)rdb.Set(ctx, "user:pii", payload, 24*time.Hour)rdb.Set(ctx, "user:pii", payload, 0)From the same buckets as this rule.