Skip to content

Releases: bartventer/httpcache

v0.12.0

01 Nov 16:22
v0.12.0
0c3be52

Choose a tag to compare

What's Changed

Features & Improvements

  • Optional Modification Time Updates for fscache
    • (8540c11) store/fscache: Added optional file modification time tracking on cache hits to enable efficient LRU cleanup strategies by @bartventer in #20
    • New DSN parameter update_mtime=on and programmatic option WithUpdateMTime(bool) for enabling this feature.
    • When enabled, cache hits update file modification times, allowing standard Unix tools to implement LRU eviction:
      # Remove files older than 7 days
      find /cache/dir -type f -mtime +7 -delete
      
      # Keep only the 1000 most recently used files
      find /cache/dir -type f -printf '%T@ %p\n' | sort -rn | tail -n +1001 | cut -d' ' -f2- | xargs rm

Documentation Improvements

  • (0cb2fde) store/acceptance: Enhanced package documentation with clearer compliance and usage guidance.
  • (7408a82) store/fscache: Enhanced documentation for cache configuration and usage examples.
  • (ecb1714): Enhanced roundtripper comments for clarity on cache backend DSN usage.
  • (18763fc) store: Updated package comments for improved clarity on driver registration and connection establishment.

Testing & CI Improvements

  • (ccde4ee) ci: Added cross-platform testing across Ubuntu, Windows, and macOS in GitHub Actions workflow.

Full Changelog: v0.11.0...v0.12.0


The project is nearing a stable v1.0.0 milestone.
Any further feedback, issues, or contributions are welcome as we finalize the implementation and documentation.

v0.11.0

29 Oct 15:11
v0.11.0
f14f6a8

Choose a tag to compare

What's Changed

Features & Improvements

  • Filesystem Cache Key Fragmentation (by @bartventer in #17)
    • (33afe4e) store/fscache: Implemented adaptive fragmentation of long cache filenames into directory structures to ensure compatibility with filesystem limits. Filenames exceeding 255 characters are split into multiple directory levels, preserving reversibility and compatibility with existing base64-encoded filenames.
    • (798f961) store/acceptance: Enhanced key listing tests to validate handling of long keys and directory structures.
    • Thanks to @eric for reporting the issue in #16.

Other Changes

  • (244b8d8): Bumped Go version to 1.25 for access to latest (*os.Root) methods.

Full Changelog: v0.10.2...v0.11.0

The project is nearing a stable v1.0.0 milestone.
Any further feedback, issues, or contributions are welcome as we finalize the implementation and documentation.

v0.10.2

04 Jul 13:48
v0.10.2
a880a8c

Choose a tag to compare

What's Changed

Performance Improvements

  • (a880a8c): Optimized slice capacity handling for better memory allocation efficiency by @bartventer

Documentation Improvements

  • (31abc27): Improved log schema formatting in documentation for better readability by @bartventer

Full Changelog: v0.10.1...v0.10.2

The project is nearing a stable v1.0.0 milestone.
Any further feedback, issues, or contributions are welcome as we finalize the implementation and documentation.

v0.10.1

01 Jul 20:58
v0.10.1
0524c4d

Choose a tag to compare

What's Changed

Bugfixes

  • (0524c4d): Clean up logging and set cache miss header on response for improved diagnostics by @bartventer.

Other Changes

  • (f642620): Update roundtripper tests to use JSON logger with debug level for clearer output by @bartventer.

Full Changelog: v0.10.0...v0.10.1

The project is nearing a stable v1.0.0 milestone.
Any further feedback, issues, or contributions are welcome as we finalize the implementation and documentation.

v0.10.0

01 Jul 15:03
v0.10.0
8093603

Choose a tag to compare

Features & Improvements

  • Structured Logging for Cache Events
    • (0d44a09): Added structured logging for cache responses and errors using Go's log/slog.
    • (247a399): Added a machine-parseable log schema (docs/log.schema.md) for all cache logs.
  • Tracing Support
    • (3545f34): Added ContextWithTraceID for distributed tracing; users can inject a trace ID into the request context to correlate cache logs with other system logs.
  • Refactor & Code Quality
    • (66aa91c): Moved transport options to a separate file for better organization.
    • (5d2cc5d): Changed IsUnsafeMethod to accept a method string instead of an http.Request.
    • (b9faeb9): Added iface and configured sloglint for improved code style and linting.

Full Changelog: v0.9.2...v0.10.0

The project is nearing a stable v1.0.0 milestone.
Any further feedback, issues, or contributions are welcome as we finalize the implementation and documentation.

v0.9.2

29 Jun 18:42
v0.9.2
a0f1e04

Choose a tag to compare

Compatibility: Optional Support for Non-Standard "UTC" Expires Headers

  • (a0f1e04): Added opt-in compatibility for HTTP Expires headers using the non-standard "UTC" timezone (as emitted by Kubernetes). Set HTTPCACHE_ALLOW_UTC_DATETIMEFORMAT=1 to enable. This is a temporary workaround and will be removed once upstream is compliant.

Full Changelog: v0.9.1...v0.9.2

The project is nearing a stable v1.0.0 milestone.
Any further feedback, issues, or contributions are welcome as we finalize the implementation and documentation.

v0.9.1

29 Jun 10:58
v0.9.1
2c86d11

Choose a tag to compare

Bugfix: Cache Keying with Empty Vary Headers

Bugfixes

  • (a180136): Fixed cache key generation to append a sentinel value when no Vary headers are present.
    This prevents collisions between the base URL key and the vary key, avoiding self-referential cache entries.

Other Changes

  • (c810fde): Improved logging for missing or unreadable cache entries.
  • (e30db2d): Improved error formatting in testutil.
  • (2c86d11): Renamed internal header constants for consistency.

Full Changelog: v0.9.0...v0.9.1

The project is nearing a stable v1.0.0 milestone.
Any further feedback, issues, or contributions are welcome as we finalize the implementation and documentation.

v0.9.0

27 Jun 10:37
v0.9.0
5afef1e

Choose a tag to compare

NewClient Convenience Function

Feature Additions

  • (5afef1e): Added NewClient function to create an http.Client with a caching transport.
    • Usage:
      import (
          "github.com/bartventer/httpcache"
          // Register the fscache backend
          _ "github.com/bartventer/httpcache/store/fscache" 
      )
      
      client := httpcache.NewClient("fscache://?appname=myapp")

Full Changelog: v0.8.1...v0.9.0


Call for Feedback

The project is nearing a stable v1.0.0 milestone.
Any further feedback, issues, or contributions are welcome as we finalize the implementation and documentation.

v0.8.1

26 Jun 17:12
v0.8.1
b56afd3

Choose a tag to compare

Bugfix: Correct Legacy Header Name for gregjones/httpcache Compatibility

This patch release corrects the legacy header name used for compatibility with gregjones/httpcache. The previous release incorrectly used X-Cache-Status; this has been fixed to use the correct legacy header, X-From-Cache.

Highlights

  • Legacy Header Correction

    • The legacy header for compatibility is now correctly set as X-From-Cache, matching the behavior of gregjones/httpcache.

    • Header Value Mapping:

      X-Httpcache-Status X-From-Cache Description
      HIT 1 Served from cache
      STALE 1 Served from cache but stale
      REVALIDATED 1 Revalidated with origin
      MISS (not set) Served from origin
      BYPASS (not set) Bypassed cache, served from origin

      X-Httpcache-Status is set on every response, while X-From-Cache is only set for cache hits, stale, or revalidated responses.

    • Example response headers for a stale cache hit:

      X-Httpcache-Status: STALE
      X-From-Cache: 1
  • No other changes were made in this release.

Full Changelog: v0.8.0...v0.8.1


Migration Note:
X-From-Cache is provided for compatibility and may be removed in a future major release. Please migrate to X-Httpcache-Status for continued support and improvements.


Call for Feedback

The project is nearing a stable v1.0.0 milestone.
Any further feedback, issues, or contributions are welcome as we finalize the implementation and documentation.

v0.8.0

26 Jun 15:26
v0.8.0
e74706b

Choose a tag to compare

Legacy Header Support, Refactors, and Documentation

This release adds compatibility with the legacy X-Cache-Status header (for easier migration from gregjones/httpcache), along with internal refactors and expanded documentation.

Highlights

  • Legacy Header Support (ebbe290, 03ebc3a)

    • Added the legacy X-Cache-Status header for migration from gregjones/httpcache.

    • Header Value Mapping:

      X-Httpcache-Status X-Cache-Status Description
      HIT 1 Served from cache
      STALE 1 Served from cache but stale
      REVALIDATED 1 Revalidated with origin
      MISS (not set) Served from origin
      BYPASS (not set) Bypassed cache, served from origin

      X-Httpcache-Status is set on every response, while X-Cache-Status is omitted for misses and bypasses.

    • Example response headers for a stale cache hit:

      X-Httpcache-Status: STALE
      X-Cache-Status: 1
  • Refactors and Documentation

    • (3948ed8, b4ae1fb): Improved code clarity and maintainability (replaced goto with labelled continue, consolidated cache revalidation logic).
    • (0a92bbe f18215f): Expanded documentation for the memcache backend and stale-while-revalidate behavior.

Full Changelog: v0.7.0...v0.8.0


Migration Note:
X-Cache-Status is provided for compatibility and may be removed in a future major release. Please migrate to X-Httpcache-Status for continued support and improvements.


Call for Feedback

The project is nearing a stable v1.0.0 milestone.
Any further feedback, issues, or contributions are welcome as we finalize the implementation and documentation.