Skip to content

HydraCache 0.33.0

Choose a tag to compare

@github-actions github-actions released this 13 Jul 16:03
· 1402 commits to main since this release

HydraCache 0.33.0

0.33.0 focuses on production ergonomics after the 0.32.0 database adapter
parity release.

Planned Highlights

  • Policy presets for common cache intent: short-lived values, read-mostly
    values, per-entity values, explicit-invalidation-only values, and negative
    cache entries.
  • Refresh/stale options for serving recently expired values while a reload is
    running or when a loader temporarily fails.
  • Shared database-neutral refresh behavior for SQLx, Diesel, SeaORM, and custom
    repository loaders.
  • Production guidance for keys, tags, TTLs, stale behavior, invalidation, and
    observability.
  • Soft cleanup tooling for generated release/test target directories.

Changes

  • Added QueryCachePolicy and PreparedQueryPolicy presets:
    short_lived, read_mostly, per_entity,
    no_ttl_explicit_invalidation, and negative_cache.
  • Added PreparedQueryPolicy::cache_entity::<T>() so prepared presets can be
    combined with HydraCacheEntity metadata without rebuilding the policy from
    scratch.
  • Added RefreshOptions and HydraCache::get_or_load_with_refresh for
    refresh_ahead, stale_while_revalidate, and bounded
    stale_on_loader_error behavior on local loader-based cache reads.
  • Added database-neutral RefreshPolicy support on QueryCachePolicy,
    PreparedQueryPolicy, DbQuery, and adapter re-exports so SQLx, Diesel,
    SeaORM, and custom repository loaders share the same stale/refresh behavior.
  • Added docs/PRODUCTION_GUIDE.md for keys/tags, presets, refresh behavior,
    invalidation safety, and observability guidance.
  • Added scripts/clean-generated-targets.ps1 for safely removing generated
    release/check target directories without a full cargo clean.
  • Reduced one refresh-path allocation by checking stale-window eligibility
    before cloning expired entries for error fallback.

Verification

This release should pass:

  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets --locked
  • cargo test --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo test --doc --workspace --locked
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --locked
  • .\scripts\package-publishable.ps1 -Set bootstrap -AllowDirty
  • .\scripts\verify-crates-io-consumer.ps1 -Version 0.33.0