Releases: bartventer/httpcache
v0.12.0
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=onand programmatic optionWithUpdateMTime(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
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
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
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
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.
- (0d44a09): Added structured logging for cache responses and errors using Go's
- Tracing Support
- (3545f34): Added
ContextWithTraceIDfor distributed tracing; users can inject a trace ID into the request context to correlate cache logs with other system logs.
- (3545f34): Added
- Refactor & Code Quality
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
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=1to 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
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
NewClient Convenience Function
Feature Additions
- (5afef1e): Added
NewClientfunction to create anhttp.Clientwith 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")
- Usage:
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
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 ofgregjones/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-Statusis set on every response, whileX-From-Cacheis 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
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-Statusheader for migration fromgregjones/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-Statusis set on every response, whileX-Cache-Statusis omitted for misses and bypasses. -
Example response headers for a stale cache hit:
X-Httpcache-Status: STALE X-Cache-Status: 1
-
-
Refactors and Documentation
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.