[package]
edition = "2024"
name = "multi-tier-cache"
version = "0.6.1"
authors = ["thichuong <thichuong22022000@gmail.com>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Customizable multi-tier cache with L1 (Moka in-memory) + L2 (Redis distributed) defaults, expandable to L3/L4+, cross-instance invalidation via Pub/Sub, stampede protection, and flexible TTL scaling"
documentation = "https://docs.rs/multi-tier-cache"
readme = "README.md"
keywords = [
"cache",
"redis",
"memcached",
"multi-tier",
"backends",
]
categories = [
"caching",
"asynchronous",
"database",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/thichuong/multi-tier-cache"
[features]
backend-memcached = ["memcache"]
backend-quickcache = [
"quick_cache",
"parking_lot",
]
default = ["redis-streams"]
redis-streams = []
[lib]
name = "multi_tier_cache"
path = "src/lib.rs"
[[example]]
name = "advanced_usage"
path = "examples/advanced_usage.rs"
[[example]]
name = "basic_usage"
path = "examples/basic_usage.rs"
[[example]]
name = "builtin_backends"
path = "examples/builtin_backends.rs"
[[example]]
name = "cache_strategies"
path = "examples/cache_strategies.rs"
[[example]]
name = "custom_backends"
path = "examples/custom_backends.rs"
[[example]]
name = "database_caching"
path = "examples/database_caching.rs"
[[example]]
name = "health_monitoring"
path = "examples/health_monitoring.rs"
[[example]]
name = "multi_tier_usage"
path = "examples/multi_tier_usage.rs"
[[example]]
name = "redis_streams"
path = "examples/redis_streams.rs"
[[example]]
name = "stampede_protection"
path = "examples/stampede_protection.rs"
[[example]]
name = "tracing_demo"
path = "examples/tracing_demo.rs"
[[test]]
name = "integration_basic"
path = "tests/integration_basic.rs"
[[test]]
name = "integration_features"
path = "tests/integration_features.rs"
[[test]]
name = "integration_invalidation"
path = "tests/integration_invalidation.rs"
[[test]]
name = "integration_multi_tier"
path = "tests/integration_multi_tier.rs"
[[test]]
name = "integration_stampede"
path = "tests/integration_stampede.rs"
[[test]]
name = "integration_streams"
path = "tests/integration_streams.rs"
[[bench]]
name = "cache_operations"
path = "benches/cache_operations.rs"
harness = false
[[bench]]
name = "invalidation"
path = "benches/invalidation.rs"
harness = false
[[bench]]
name = "multi_tier"
path = "benches/multi_tier.rs"
harness = false
[[bench]]
name = "serialization"
path = "benches/serialization.rs"
harness = false
[[bench]]
name = "stampede_protection"
path = "benches/stampede_protection.rs"
harness = false
[dependencies.anyhow]
version = "1.0"
[dependencies.bytes]
version = "1.6"
[dependencies.dashmap]
version = "5.5"
[dependencies.futures-util]
version = "0.3"
[dependencies.memcache]
version = "0.17"
optional = true
[dependencies.moka]
version = "0.12"
features = ["future"]
[dependencies.parking_lot]
version = "0.12"
optional = true
[dependencies.quick_cache]
version = "0.6"
optional = true
[dependencies.redis]
version = "1.0.2"
features = [
"tokio-comp",
"connection-manager",
]
[dependencies.serde]
version = "1.0"
features = ["derive"]
[dependencies.serde_json]
version = "1.0"
[dependencies.tokio]
version = "1.43"
features = [
"sync",
"macros",
"time",
]
[dependencies.tracing]
version = "0.1"
[dev-dependencies.criterion]
version = "0.5"
[dev-dependencies.rand]
version = "0.8"
[dev-dependencies.tokio]
version = "1.43"
features = ["full"]
[dev-dependencies.tracing]
version = "0.1"
[dev-dependencies.tracing-subscriber]
version = "0.3.20"
features = ["env-filter"]
[lints.clippy]
expect_used = "warn"
indexing_slicing = "warn"
pedantic = "warn"
unwrap_used = "warn"