Skip to content

Docs: Clarify Valkey cache usage across /temperature and /readyz endpoints #38

@abdelrahman495

Description

@abdelrahman495

Clarify where the Valkey cache is read in Phase 5 - 5.2 Code

Location

Phase 5 → 5.2 Code → Readyz → Requirements
https://devopsroadmap.io/projects/hivebox/#52-code

File: docs/projects/hivebox/README.md

Problem

The spec currently only mentions the Valkey cache in the context of the /readyz endpoint (checking whether cached data is fresh). This creates ambiguity about whether the /temperature endpoint should also read from the cache layer to avoid hammering the openSenseMap API on every request — or whether doing so would be considered scope creep.

As clarified by @aabouzaid:

  • The /temperature endpoint is the one that should read from the Valkey cache (to serve cached data and reduce repeated calls to openSenseMap).
  • The /readyz endpoint does not do any caching, it only checks the cache timestamp to verify data freshness.

Since the spec doesn't explicitly state that /temperature reads from the cache, contributors may avoid doing so thinking it goes beyond the intended design, or alternatively may misplace caching logic inside /readyz.

Suggested fix

Update the spec to explicitly state the role of each endpoint with respect to the cache:

  • Under /temperature: mention that it should read temperature data from the Valkey cache (writing to it if needed) to avoid repeated calls to the openSenseMap API.
  • Under /readyz: clarify that it only reads the cache timestamp to check data freshness, and is not responsible for caching itself.

Impact

Without this clarification, the intended caching architecture is ambiguous, which can lead learners to either skip caching in /temperature or question whether it's in scope at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions