Skip to content

Phase 3-3: Adaptive Cache TTLs #2681

Open

Description

@ashleyshaw

Overview

Replace fixed TTL caching with intelligent, data-pattern-aware TTL strategies.

Objective: Increase cache hit rates beyond Phase 2C's 55% by using adaptive TTLs that match data update patterns for different GitHub entities.

Context

Phase 2C implemented fixed 5-minute TTL caching across all queries. However, different data has different update frequencies:

  • Labels and milestones: rarely change (could use 1-hour TTL)
  • PR status: frequently changes (needs 1-minute TTL)
  • Issue assignments: moderately frequent changes (5-10 minute TTL)

Fixed TTLs compromise between staleness and cache hit rate. Adaptive TTLs can optimize both.

Success Metrics

  • Overall cache hit rate improvement from 55% → 65-75%
  • Reduced API calls by additional 5-10% vs Phase 2C
  • Zero cache staleness incidents in staging validation
  • Configurable per-data-type policies
  • 100% test coverage for TTL policy logic

Deliverables

  • Adaptive cache manager (scripts/automation/includes/adaptive-cache.js)
  • TTL policies by data type (labels, PRs, issues, assignees, milestones)
  • Cache invalidation triggers (webhook-based invalidation)
  • Metrics tracking (hit rate, staleness events, TTL distribution)
  • Configuration schema for TTL policies

Acceptance Criteria

  • Adaptive cache manager implemented
  • Per-data-type TTL policies defined and configurable
  • Cache hit rate improved to 65-75% (from 55%)
  • Webhook invalidation patterns tested
  • Zero staleness incidents in staging (7-day validation)
  • Performance regression detection in Phase 3-2 validates improvements
  • Configuration documentation complete

Dependencies

  • Phase 2C response cache exists
  • Webhook integration research (Phase 3-5) informs invalidation strategy
  • Phase 3-2 continuous benchmarking for validation

Estimated Effort

6-8 business days

Links

  • Phase 3 Planning: PHASE_3_PLANNING.md
  • Outstanding Gaps: OUTSTANDING_GAPS.md``
  • Phase 2C Cache Implementation: scripts/automation/includes/response-cache.js

Phase 3 planning issue for secondary automation script optimization project.

Activity

  1. linear-code commented on Sep 3, 2026

    @linear-code
  2. github-actions commented on Sep 3, 2026

    @github-actions
    Contributor

    ⚠️ This issue does not follow a required issue template.

    Missing required section(s): Definition of Ready (DoR), Definition of Done (DoD)

    The issue will remain open and flagged until the body is corrected.
    Please update the issue with one of the official templates:

    If this was opened by automation, update the automation to preserve the template sections before creating the issue.

  3. added this to the v1.1 milestone on Sep 3, 2026
  4. self-assigned this
    on Sep 3, 2026
  5. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

    ⚠️ Bare Labels Detected

    This issue has labels that are not in the canonical taxonomy:

    • migrate:priority:normal
    • migrate:status:needs-more-info
    • migrate:type:feature
    • migrate:area:automation
    • migrate:area:performance

    Valid Canonical Labels

    Please use labels with a prefix from the canonical taxonomy:

    • Type: type:bug, type:feature, type:task, type:documentation, etc.
    • Status: status:needs-triage, status:in-progress, status:done, etc.
    • Priority: priority:critical, priority:high, priority:normal, priority:low
    • Area: area:ci, area:docs, area:labels, area:security, etc.
    • Meta: meta:needs-changelog, meta:duplicate, meta:blocked, etc.

    For the complete list, see .github/labels.yml.

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

Metadata

Metadata

Assignees

Fields

Priority

None yet

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions