Skip to content

Implement caching layers for whurl client #21

@nicmostert

Description

@nicmostert

Overview

Implement a robust, layered caching strategy for the whurl client, with clear separation of responsibilities and interfaces for each layer.

Caching layers (sub-issues):

  1. Domain-layer cache (canonical data):
    • Caches raw, unfiltered site and measurement lists in memory (and optionally disk).
    • API examples: client.list_sites(refresh=False), client.check_for_site(name, refresh=False).
    • Handles normalization, index building, refresh logic.
    • First to implement (see sub-issue).
  2. HTTP-layer cache (transport-level cache):
    • Intercepts GET/HEAD requests, uses ETag/Last-Modified and Cache-Control to serve fresh or revalidated responses.
    • Respects server cache headers and conditional requests.
    • Pluggable backend (memory/disk), with a size-limited LRU.
    • Sub-issue details to follow.
  3. Query memoization layer (hot filtered queries):
    • Small, short-lived cache for expensive filtered queries (e.g., measurement filters).
    • Built atop domain-layer cache; optional, not persisted.
    • Sub-issue details to follow.

Each layer should be modular, well-documented, and testable. Sub-issues will cover detailed API, implementation, and acceptance criteria for each layer.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions