Skip to content

Add smart lifetime#1

Open
rmccue wants to merge 13 commits intomainfrom
add-smart-lifetime
Open

Add smart lifetime#1
rmccue wants to merge 13 commits intomainfrom
add-smart-lifetime

Conversation

@rmccue
Copy link
Copy Markdown
Member

@rmccue rmccue commented Feb 18, 2025

Replaces Longcache's fixed lifetime with a smarter cache lifetime system based on the age of content and frequency of updates.

This content naturally expires within a few minutes anyway, so should
not be manually invalidated. This prevents a flood of invalidations when
content is first created, which also tends to happen at the highest
traffic time.
@rmccue rmccue requested a review from joehoyle February 18, 2025 16:01
Copy link
Copy Markdown
Member

@mattheu mattheu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I like the implementation and the logic is good. However I think it would be nice for the LIFETIME_SHORT/MEDIUM/LONG constants to be filterable. This would for some experimentation and everything else is very customisable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants