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.
Resending Expired Links
When an admin resends a training plan or brochure link via the Resend button on the respective list page:
- The current
expires_atis checked. - If expired, a new UUID token is generated and
expires_atis recalculated using the currently configured expiry setting. - The email is sent with the new link.
- 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.settingstable 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/settingsandPUT /api/v1/settingsendpoints manage this table (admin-only).