-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
priority/mediumMedium priority - Important but not urgentMedium priority - Important but not urgenttype/featureNew feature requestNew feature request
Description
Feature Request
Implement caching to avoid re-downloading same images and pages across runs.
Current Behavior
- Re-downloads images even if already present
- Re-fetches wiki pages even if unchanged
- Wastes bandwidth and time
Proposed Solution
from diskcache import Cache
class CachedHTTPClient:
def __init__(self, cache_dir='.wikiaccess_cache'):
self.cache = Cache(cache_dir)
def get_page_raw(self, page_id: str):
cache_key = f'page:{page_id}'
if cache_key in self.cache:
return self.cache[cache_key]
content = self._fetch_from_wiki(page_id)
self.cache.set(cache_key, content, expire=3600)
return contentFeatures
- Cache with TTL (configurable expiration)
- Cache invalidation command
- Conditional requests (If-Modified-Since headers)
- Cache statistics
- Respect Cache-Control headers
Tasks
- Add diskcache or requests-cache dependency
- Implement page caching
- Implement image caching
- Add cache configuration options
- Add
wikiaccess cache clearcommand - Add
wikiaccess cache statscommand - Add
--no-cacheflag for fresh fetches
Metadata
Metadata
Assignees
Labels
priority/mediumMedium priority - Important but not urgentMedium priority - Important but not urgenttype/featureNew feature requestNew feature request