Skip to content

Wire disk cache eviction at startup (B7) #5

Description

@Ashex

Context

The disk image cache under $SKEETS_DATA_DIR/cache/ has no size limit and no eviction during app operation. Every image URL writes a raw RGBA file (typically 20-200KB each). After browsing a few hundred posts, this can consume hundreds of MB on the Kobo's limited eMMC storage (8-32GB shared with books).

The eviction function image_evict_disk_cache(max_bytes) already exists in src/util/image.cpp (implements oldest-first eviction by mtime). It is simply never called.

Sub-tasks

  • Call image_evict_disk_cache(50 * 1024 * 1024) at app startup in src/kobo/main.cpp
  • Consider periodic eviction during long sessions (e.g. every N minutes or after N cache writes)
  • Add a log line when eviction runs so cache behavior is observable in sKeets.log

References

  • Eviction implementation: src/util/image.cpp image_evict_disk_cache()
  • Cache writes: src/util/image_cache.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions