Comments (3)
你指的是 storage 不是内存吧?
目前的策略比较简单,每分钟遍历一遍把过期的数据删掉。
还没想好怎么把各种策略(比如FIFO、LRU)集成进来。
from tua-storage.
指的是 storage。
实际项目中可能有人把过期时间设置的很长,以至于不能及时清除数据,导致存储满了。
目前工作的项目中,计划当storage存储使用大于一个值后,采用FIFO,或者按过期时间远近两种策略清除缓存,不太确定的是什么时候计算storage使用量比较好,如果每次存的时候计算,会不会太频繁了。
from tua-storage.
我想想...
在 storage 里存这样一个数据:每条记录的保存时间,过期时间,上次使用时间、大小等信息。
基于这个数据就可以做一些策略控制?
from tua-storage.
Related Issues (15)
- 当前是 Node 场景,传入对象时,希望控制台不打印提示
- 增加对于 CacheStorage 的支持
- 增加对于 indexedDB 的支持
- 升级 babel v7
- 使用 TypeScript 重构
- 升级 rollup 到 v1.0
- 增加 Vue 插件的支持
- feat: add an online example
- feat: add `syncOptions` options
- bug: 返回值只有 code 和 data
- bug: QuotaExceededError The quota has been exceeded.
- bug: 小程序端自动请求失效
- 完整文档地址访问404 HOT 1
- 能否提供接口的同步版本 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tua-storage.