xxf-cache

Unify in-memory LRU, disk cache, and @PreferenceWrapper KV storage.

6|1|Updated May 22, 2025
One-click install
npx skills add https://github.com/NBXXF/xxf_ios --skill xxf-cache
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xxf-cache
Source: https://github.com/NBXXF/xxf_ios/tree/main/skills/xxf-cache
Command: npx skills add https://github.com/NBXXF/xxf_ios --skill xxf-cache

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

为应用提供一个统一的缓存层,整合内存缓存、磁盘缓存和声明式 KV 存储,简化缓存策略并提升性能和一致性。

Core Features & Use Cases

  • 内存 LRU 缓存、磁盘缓存、@PreferenceWrapper KV 存储,构建统一的缓存体系
  • 触发场景包括存用户偏好、网络响应缓存、短期数据,确保数据可用性与响应速度
  • 与 XXFHttp、@PreferenceWrapper 等模块协同工作,形成端到端的缓存解决方案

Quick Start

使用提供的 API 声明缓存并根据业务场景选用内存、磁盘或 KV 存储,快速集成到应用中。

Frequently Asked Questions about xxf-cache

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a unified cache layer for memory, disk, and KV storage?

Memory LRU and disk caching differ by storage location and eviction strategy. Memory LRU keeps recently accessed data in RAM for fast retrieval, while disk cache persists data to storage, ensuring data availability across sessions for network response caching.

What is the best way to cache user preferences and network responses in Android applications?

Yes, you can use PreferenceWrapper KV storage for short-lived session data. It provides a standardized KV integration that ensures deterministic behavior and fast access for temporary session information alongside memory and disk caches.

When should I use disk cache instead of memory LRU cache for data storage?

You should use disk cache instead of memory LRU when you need data persistence across app restarts. Disk cache stores data permanently on the device, whereas memory LRU cache is volatile and clears when the app terminates, suitable for short-lived data.

Does this unified cache work with XXFHttp for network response caching?

Yes, the unified cache works with XXFHttp for network response caching. It coordinates with modules like XXFHttp and PreferenceWrapper to form an end-to-end caching solution, accelerating data retrieval and ensuring consistency.