-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
Currently, pyconify automatically creates a cache that loads into RAM, which can lead to excessive memory usage and cause system hangs or performance degradation in long-running applications. There is no built-in way to disable caching or set a time-to-live (TTL) for cached data.
Problem Statement:
- The cache keeps accumulating in RAM, leading to high memory consumption.
- Constantly clearing the cache on every request is not an ideal solution.
- There should be an option to either disable the cache entirely or set an expiration time (TTL) to manage memory usage more efficiently.
Proposed Solution:
- Introduce an optional parameter to disable caching
Example: @pyconify(use_cache=False) - Provide a TTL (time-to-live) option for cache expiration
Example: @pyconify(cache_ttl=300) # Cache expires after 300 seconds
Expected Behavior:
- If use_cache=False, pyconify should bypass cache creation.
- If cache_ttl is set, cached data should automatically expire after the given time, preventing unbounded memory usage.
- The default behavior should remain unchanged for backward compatibility.
Would appreciate your thoughts on this! Thanks for maintaining pyconify. 🚀
Metadata
Metadata
Assignees
Labels
No labels