从缓存中删除密钥 [英] Remove keys from cache

查看:76
本文介绍了从缓存中删除密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 memcached 和 C++.我想使用 c++ api 从服务器中删除所有密钥.最好在没有键列表的情况下删除它们.

I'm using memcached and c++. I want to remove all keys from server using c++ api. It would be better to remove them without list of the keys.

文档中有函数:memcached_dumpmemcached_delete.第一个返回键列表,第二个 - 删除它们.

There is function in documentation: memcached_dump and memcached_delete. First one returns the list of keys, and the second one - removes them.

但这里引用了第一个函数的文档:

But here is the quote from the docs of first function:

memcached_dump() 用于获取在 memcached(1) 中找到的键列表服务器.因为 memcached(1) 不保证转储您的所有密钥不能假设您已从服务器获取所有密钥.

memcached_dump() is used to get a list of keys found in memcached(1) servers. Because memcached(1) does not guarentee to dump all keys you can not assume you have fetched all keys from the server.

第一个问题:获取所有键的任何方法,第二个问题是:如何使用这些函数.文档中没有任何示例.

The first question: any ways to fetch ALL keys and the second is: how to use these functions at all. There aren't any examples in documentation.

谢谢.

推荐答案

听起来像你想要的 memcached_flush ?

Sounds like you want memcached_flush ?

这篇关于从缓存中删除密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆