iluwatar / iluwatar/java-design-patterns
Caching Filter pattern
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 94.7k
- Forks
- 27.4k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 10
Description
Description:
The Caching Filter design pattern aims to improve the performance and scalability of an application by caching the results of expensive operations and reusing them for identical subsequent requests. This pattern is particularly useful in scenarios where the same data is frequently requested, and the cost of recomputing the data is high.
Main Elements of the Pattern:
- Filter: Intercepts requests and checks if a cached response is available.
- Cache Store: A storage mechanism for saving and retrieving cached data.
- Cache Key: A unique identifier for caching entries based on request parameters.
- Expiration Policy: Defines how long cached data is considered valid.
- Cache Miss Handler: Fetches data from the original source when a cache miss occurs and populates the cache.
References:
Acceptance Criteria:
- Implement a basic Caching Filter that can intercept requests and check for cached responses.
- Develop a simple cache store with a configurable expiration policy.
- Ensure comprehensive unit tests are provided to validate the correct functionality of the caching mechanism.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file, entry point, or test location is named in the issue, so begin by reviewing the existing Java design-pattern examples in the repository and identifying where a Caching Filter belongs. Done means implementing the requested filter, cache store, expiration policy, cache-miss handling, and comprehensive unit tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100