Git Product home page Git Product logo

kakacache's Introduction

咔咔缓存(KakaCache)

咔咔一声,缓存搞定。这是一个专用于解决Android中网络请求及图片加载的缓存处理框架

项目目标

本项目是作为实验项目,不保证其稳定性及可靠性
因为缓存业务的复杂性,本项目尽可能适应更多的使用场景
目前考虑到的,会实现的功能清单,会在下方依次罗列出来

任务清单(欢迎各路好汉行侠仗义!)

task_list.md

缓存层级 - 更优良可靠的缓存

  • Internet临时缓存
  • 磁盘缓存
  • 内存缓存

缓存策略 - 尽可能适应多种使用场景

  • 仅缓存
  • 仅网络
  • 优先缓存
  • 优先网络
  • 先缓存后网络

缓存置换算法 - 多种实现,按需选择

  • 先进先出算法(FIFO):最先进入的内容作为替换对象
  • 最近最少使用算法(LFU):最近最少使用的内容作为替换对象
  • 最久未使用算法(LRU):最久没有访问的内容作为替换对象
  • 非最近使用算法(NMRU):在最近没有使用的内容中随机选择一个作为替换对象
  • 其他算法,包括变种算法和组合算法

存储策略 - 支持不同数据的缓存需求

  • 不存储
  • 仅内存
  • 仅磁盘
  • 内存+磁盘

线程管理 - 异步执行

  • 支持多线程操作
  • 支持异步执行,UI线程回调

自动清理 - 自动检查

  • 缓存过期后,自动清理
  • 存储空间不足时,清理超出数据
  • 存储个数超量时,清理超出数据

配置项 - 约定大于配置

  • 策略
  • 存储空间大小
  • 存储个数
  • 有效期
  • 是否启用缓存
  • 置换算法
  • 线程池大小
  • 缓存实现
  • 任务优先级

项目分层结构

common >> core >> manager >> netcache\imagecache
公用类 >> 存储核心 >> 缓存管理 >> 应用缓存
  • common 通用代码,一般为通用工具类或通用基类,也包含丰富语言特性的基础代码等
  • core 数据存储,负责数据的读取和写入,不关心线程等
  • manager 缓存管理,包括但不限于线程等的管理
  • netcache 网络缓存,针对网络请求的特点,优化缓存功能,重点在于数据同步问题
  • imagecache 图片缓存,因图片的同步要求不那么苛刻,可以适当的放宽缓存条件

关于

  • 这是一个开源项目,在不断思考完善中慢慢走向成熟
  • 如果你觉得这个项目不错,欢迎 ★ Star
  • Follow 我 就更好了
  • 你的支持是我持续开源的动力!!!

kakacache's People

Contributors

nukc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.