Skip to content
CAI
Software that uses CAICheck a score

tanguilp/http_cache

55.8

Adequate · 2 October 2026

2.4k

lines of production code

Erlang

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is an HTTP caching library that manages cache storage and retrieval behavior in compliance with RFC 7234 and RFC 9111. It provides configurable handling for stale content directives, such as stale-if-error and stale-while-revalidate, and supports extensible storage backends through a defined store behavior interface. The library includes utilities for managing cache candidates, invalidating URLs, and notifying about response usage, with test coverage ensuring correctness across various HTTP status codes and edge cases.

Behavioural changes

HTTP caching library major release to v1.0.0 with store behavior refactor

The library has been updated to version 1.0.0, introducing a breaking change to the cache store interface by replacing the \http\_cache\_store\ behavior with \http\_cache\_store\_behaviour\. This refactor updates the store callback signatures, such as adding options maps to \list\_candidates\, \get\_response\, and \invalidate\_url\, and renaming \notify\_resp\_used\ to \notify\_response\_used\. The public API also changes, exporting \notify\_downloading/3\ instead of the previous \notify\_use/2\ and adding \cache/4\ alongside \cache/3\. Additionally, the \http\_cache\_store\_process\ implementation now supports storing response bodies in temporary files via a new \save\_in\_file/0\ helper for testing purposes.

src · high confidence

http\_cache v0.4.0: Updated stale directive handling and dependency architecture

The \http\_cache\ library has been updated to version 0.4.0, introducing significant changes to how stale content directives are processed and altering the underlying dependency structure. Behaviorally, the library now correctly accounts for \stale-if-error\ and \stale-while-revalidate\ directives when calculating grace periods, and \max-stale\ now takes precedence over \stale-while-revalidate\ (meaning \max-stale=0\ prevents returning stale responses even if \stale-while-revalidate\ is set). The \stale-if-error\ directive handling has changed, with stale responses now returned by the \cache/3\ and \cache/4\ functions, which have also had their signatures updated. Additionally, the \allow\_stale\_while\_revalidate\ option was renamed to \stale\_while\_revalidate\_supported\, while the \stale\_if\_error\ and \origin\_unreachable\ options were removed. Architecturally, the project has shifted from a git-based \cowlib\ dependency to using hex packages (\cowlib \~\> 2.0\, \telemetry \~\> 1.0\, and the new \http\_cache\_store\_behaviour \~\> 1.0\), and updated its build tooling to use \rebar3\_ex\_doc\ and \erlfmt\.

(repo-wide) · high confidence

Test coverage

Expanded test coverage for HTTP cache behavior and RFC compliance

Added and updated tests in \http\_cache\_test.erl\ to verify cache handling logic, including stale-if-error scenarios, range requests with content encoding, and compliance with RFC 7234 and RFC 9111 specifications. The test suite now covers a broader range of HTTP status codes, cache control directives, and edge cases such as backend storage in files and response decompression.

test · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 54 → 56 (+2.3)
  • Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 98 → 98 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 39 → 39 (+0.0)
  • Readiness 36 → 43 (+6.5)
  • Security 100 → 100 (-0.4)

Resolved (3)

  • Coverage not measured — no coverage collector is wired up
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)

New (2)

  • Medium CVE: EEF-[CVE redacted] (rebar.lock)
  • Outdated: cowlib

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

tanguilp/http_cache was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 2 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 30f98366ed4402da5d95f33cc588c6dba3692f42 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.