h3ravel / h3ravel/framework

Feat: Integrate Cacheable for cache management

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
@h3ravel/cache enhancement Feature Requirement help wanted performance
Dominant language
TypeScript
Stars
22
Forks
14
PR merge metrics
No merged PRs in 30d

Description

**Background:** Applications need a unified caching layer to improve performance and reduce redundant computations. Integrating [Cacheable](https://github.com/jaredwray/cacheable) (or similar) will provide a consistent API for working with different cache backends like memory, Redis, or database.

**Tasks:**

* [ ] Add Cacheable as dependency.
* [ ] Add your implementation to the [framework/cache](https://github.com/h3ravel/framework/tree/main/packages/cache) package directory
* [ ] Implement `CacheManager` to configure and manage multiple cache stores.
* [ ] Provide drivers for `memory` and `redis` out of the box.
* [ ] Add helpers for common operations: `put`, `get`, `forget`, `remember`.
* [ ] Add support for tagging and TTL (time-to-live).
* [ ] Write unit tests for each driver and helper.
* [ ] Document cache usage with examples.

**Acceptance criteria:**

* Developers can configure cache stores in config (`memory`, `redis`, etc.).
* Interface mirrors laravel as much as possible, creating the familiar DX while also adding it own unique twists and turns.
* `Cache.put` stores and expires values as expected.
* `Cache.remember` fetches from cache or computes and stores if missing.
* Tests validate behavior across drivers.

**Difficulty:** medium

Contributor guide

Open the contributing guide

Research direction

Start in the packages/cache directory and review the Cacheable project linked in the issue. Map the CacheManager, memory and Redis drivers, configuration, helpers, TTL, and tagging to the acceptance criteria, then add unit tests for each driver and helper plus usage examples. Done means both drivers and the documented cache operations satisfy the listed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
redis, typescript
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.