[Discuss] client-side-cachin
See original GitHub issue官方文档:https://redis.io/topics/client-side-caching
客户端缓存是一种用于创建高性能的技术。利用应用程序的可用内存,将 redis-server 信息的某些数据直接存储在应用程序端。
使用客户端缓存时,而无需再次请求 redis-server
FreeRedis 怎样提供 API 给使用者
目前功能已经走通,demo:https://github.com/2881099/FreeRedis/tree/master/examples/console_netcore31_client_side_caching
192.168.164.10:6379 > GET Interceptor01
sdflkjyuiyui
(1ms)
Not connected > GET Interceptor01
sdflkjyuiyui
(0ms)
Not connected > GET Interceptor01
sdflkjyuiyui
(0ms)
Not connected > GET Interceptor01
sdflkjyuiyui
(0ms)
第一次从 redis-server 读取数据缓存到本地,后面的三次直接从本地内存读出来的数据。
因为本地内存有限,不能无限制将内容缓存起来。主要解决缓存条件。
- 1、什么样的 key 才被缓存到本地(热点 key 的判断标准?)
- 2、本地缓存使用什么类(字典?)
- 3、缓存的容量对外怎么设置?
- 4、本地缓存规则,xxx* 永久缓存? yyy* 缓存 60分钟?
- 5、缓存删除通过,是 redis-server 推送订阅消息进行的,所以存在延后现象,比如我刚 Set(“key1”, xxx) 程序马上要 Get key1,读到的仍然是本地缓存数据。怎么解决,如果强制向 redis-server 读取数据的话,API 怎么设计
- 6、加入布隆过滤器功能?
伪代码:
cli.UseClientSideCaching(new Options
{
Policy = new [] {
"xxxx*" : -1,
"yyy*": 60m
}
});
欢迎踊跃发表意见
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Server-Side Caching vs. Client-Side Caching Explained
Client-side caching, or browser caching, is a web-caching process that temporarily stores the copy of a web page in the browser memory instead ......
Read more >Client-side caching in Redis
Client-side caching is a technique used to create high performance services. It exploits the memory available on application servers, servers that are usually ......
Read more >Server-side caching Client-side caching
In Client-side Caching, we try to cache enough information about a webpage without creating repetitive requests to the server. These are of the ......
Read more >Cache me outside. What is Client Side Cache, Server Side…
Client Side Caching is often called Browser Caching, although Client Side Caching is a slightly broader term. How it works:.
Read more >How We Applied Client-Side Caching to Improve Feature ...
Caching is an effective way of improving scalability, latency, and reliability while maintaining integrity. By adding caching layers, the ground ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
已完成如下功能,解决:
交给外部处理,如下 KeyFilter 委托
使用并发字典
交给外部处理,如下 Capacity 设置
交给外部处理,如下 CheckExpired 委托
内部已处理,本地执行命令之后,AOP 会删本地缓存,再次执行命令就不会从本地缓存读取了
待续
如下测试,缓存目前主要解决 GET/MGET 的使用:
设置 cli.Notice 事件在控制台输出内容:
Not connected 代表没有经过 redis-server
1、广播需要客户端来甄别数据。 2、重定向方案好。
看样子组播会好一点,如果官方能提供 UDP 客户端驱动来管理密钥和过期更新策略则极好。另外密钥传输场景像TFO的样子,目测有升级的余地,或许可以问问官方后期计划。