Skip to content

Implement domain-layer cache for canonical site and measurement lists #22

@nicmostert

Description

@nicmostert

Overview

Implement the domain-layer cache for whurl. This layer stores canonical, unfiltered site and measurement lists in memory, and powers fast existence checks and index queries.

Acceptance Criteria

  • Store full site and measurement lists as normalized indexes (e.g., name→id, id→metadata).
  • Implement API:
    • client.list_all_sites(refresh=False): Returns cached or refreshed site list.
    • client.check_for_site(name, refresh=False): Returns True if site exists in cached index.
    • client.get_site(name): Returns site metadata by name.
    • client.list_all_measurements(refresh=False): Returns measurements.
    • client.refresh_sites(), client.refresh_measurements(): Explicit refresh methods.
  • Normalize names (case, whitespace, optional ASCII fold).
  • Refresh logic should prefer ETag/Last-Modified revalidation from backing HTTP resource if available.
  • Document cache structure, TTLs, and invalidation logic.
  • Comprehensive tests for cache correctness, refresh, and API.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions