Skip to content

Configurable Link Expiry

Overview

Tokens generated for downloading time-limited assets (Training Plans and Course Brochures) have configurable expiry durations. These are managed via the perfxcel.settings table — no code deploy required to change them.

Settings Keys

Key Default Description
training_plan_expiry_days 180 Days a training plan download link remains valid
brochure_expiry_days 180 Days a course brochure download link remains valid

Valid values are integers between 1 and 3650 (10 years).

Admin Configuration

Navigate to Settings in the Perfxcel Admin portal. Two number inputs let you adjust each expiry independently. Changes take effect immediately for any new links generated after saving — existing tokens keep their original expires_at.

When an admin resends a training plan or brochure link via the Resend button on the respective list page:

  1. The current expires_at is checked.
  2. If expired, a new UUID token is generated and expires_at is recalculated using the currently configured expiry setting.
  3. The email is sent with the new link.
  4. The admin sees a confirmation: "Sent! (link regenerated)" if a new token was issued, or "Sent!" if the existing token was still valid.

Technical Details

  • The perfxcel.settings table has columns: setting_key (TEXT PK), setting_value (JSONB), updated_at.
  • The API reads settings via an in-process cache with a 5-minute TTL — a value change propagates to all new requests within 5 minutes without restarting the server.
  • The GET /api/v1/settings and PUT /api/v1/settings endpoints manage this table (admin-only).