SuperAPI AI Directory

ttl_management

General & other

View repository

Updated 10-16 04:31

About this skill

ttl_management

Management of differentiated Time-To-Live (TTL) by data type to ensure that temporary data is automatically deleted and to comply with GDPR minimum retention requirements.

When to use

Use in the cache_agent to assign the appropriate TTL to each type of cached data. Biometric data has a strict TTL of 15 minutes per privacy policy.

Instructions

  1. Define TTLs by type:
    • Active session: 15 minutes (session:{id})
    • Cached embeddings: 10 minutes (embedding:{hash})
    • OCR results: 10 minutes (ocr:{hash})
    • Rate limiting counters: 1 hour (rate:{ip})
    • Config/thresholds: 5 minutes (config:*)
    • Geo-IP cache: 1 hour (geoip:{ip})
  2. Always use SET key value EX ttl_seconds.
  3. Never create keys without TTL for session data.
  4. Check remaining TTL: TTL key.
  5. Renew TTL on active accesses if necessary: EXPIRE key ttl.
  6. Monitor keys without TTL: alert if there are session keys without expiration.

Notes

  • GDPR requires deletion of biometric data as soon as possible; 15 min is the maximum.
  • Use EXPIREAT for expiration at an absolute timestamp when synchronization is needed.
  • TTLs are validated in CI with tests that verify that every session key has a TTL.