Cache Cleanup
Cache Cleanup removes expired cache entries based on their TTL (Time To Live) settings to keep your database clean and efficient.
What It Doesโ
The Cache Cleanup tool:
- Checks all cache entries for expiration
- Finds entries where
expires_atis in the past - Permanently deletes expired entries
- Reports how many were removed
When to Useโ
Good Times to Runโ
- Weekly maintenance: Keep database clean
- Monthly review: Clear accumulated expired entries
- Before major updates: Clean slate for new content
- When database seems slow: Free up space
How Oftenโ
| Frequency | Recommendation |
|---|---|
| Weekly | High-traffic systems |
| Monthly | Standard usage (recommended) |
| Quarterly | Low-traffic systems |
Understanding TTL (Time To Live)โ
Each cache entry can have a TTL that determines when it expires:
| TTL Setting | Meaning |
|---|---|
| No TTL | Entry never expires automatically |
| 30 days | Entry expires 30 days after creation |
| 90 days | Entry expires 90 days after creation |
| Custom | Any number of days |
Why Entries Expireโ
Entries should expire when:
- Information changes regularly (deadlines, dates)
- Content needs periodic review
- Temporary information (events, announcements)
How to Useโ
Running Cleanupโ
- Go to the Maintenance page
- Find the Cache Cleanup section
- Click Cleanup Expired Entries
- Wait for the result message
Understanding Resultsโ
The result shows how many entries were removed:
- "Cleaned 0 expired entries" - No expired entries found (good!)
- "Cleaned 15 expired entries" - 15 entries were removed
What Gets Deletedโ
Deletedโ
- Entries where
expires_atdate has passed - Both active and inactive expired entries
NOT Deletedโ
- Entries without TTL (no expiration set)
- Entries within their TTL period
- Entries where
expires_atis in the future
Before Running Cleanupโ
Check What Will Be Removedโ
Before cleanup, you can preview expired entries:
- Go to Cache Management
- Sort by expiration date
- Review entries that are past due
- Decide if any should be renewed instead
Renew Important Entriesโ
If you find expired entries worth keeping:
- Edit the entry in Cache Management
- Update the content if needed
- Set a new TTL or remove TTL
- Save - the entry is now renewed
After Cleanupโ
Verify Successโ
- Check the result message for count
- Review Cache Management to confirm removal
- Check Performance Metrics for impact
No Impact on Active Contentโ
Cleanup only affects expired entries:
- Active, non-expired entries are untouched
- Users won't notice any change
- Only outdated content is removed
Best Practicesโ
Set Appropriate TTLsโ
When creating cache entries, consider TTL:
| Content Type | Suggested TTL |
|---|---|
| Evergreen content | No TTL |
| Semester-specific | 120 days |
| Event information | 30-60 days |
| Deadline dates | Until deadline + 7 days |
Regular Maintenanceโ
- Run cleanup on a regular schedule
- Don't let expired entries accumulate
- Monitor the count trend over time
Review Before Deletingโ
- Periodically check what's expiring
- Renew valuable content
- Update TTLs as needed
Troubleshootingโ
Nothing Removedโ
If cleanup shows 0 entries:
- You may not have expired entries (good!)
- Check if TTLs are set on your entries
- Review Cache Management for expiration dates
Too Many Removedโ
If cleanup removes many entries:
- Your TTLs may be too short
- Review and adjust TTL settings
- Consider which content should be permanent
Accidentally Deleted Important Contentโ
Unfortunately, cleanup deletions are permanent. To prevent this:
- Review expiring content regularly
- Renew important entries before expiration
- Use appropriate TTLs when creating entries
Related: