如何确定memcached中的数据何时到期?

时间:2022-05-27 07:19:49

I am working on a PHP Laravel project as a tester and I am trying to test to make sure that some data in Memcached (running this locally) only expires after 30 days. But I am having trouble figuring out how to identify the expiration date/time of data in Memcached.

我正在开发一个PHP Laravel项目作为测试人员,我正在尝试测试以确保Memcached(本地运行)中的某些数据仅在30天后过期。但我无法弄清楚如何在Memcached中识别数据的到期日期/时间。

I tried using telnet and I am not having much luck there. I tried using a PHP-based Memcache tool. I have also tried a few clients that I found on the web but nothing seems to be working right (loading up without issues). Thoughts?

我尝试使用telnet,我没有太多运气。我尝试使用基于PHP的Memcache工具。我也尝试了一些我在网上找到的客户端,但似乎没有任何工作正常(加载没有问题)。思考?

The PHP-based tool doesn't give an expiration date and I can't seem to access that information anywhere in any of the other tools. My local machine is an Ubuntu 12.10 box.

基于PHP的工具没有给出过期日期,我似乎无法在任何其他工具中的任何地方访问该信息。我的本地机器是Ubuntu 12.10盒子。

1 个解决方案

#1


1  

You cannot retrieve that data from memcached. If you need it, serialize it with the object you are storing.

您无法从memcached中检索该数据。如果需要,请使用您正在存储的对象对其进行序列化。

Here is a question similar to yours with good answers.

这是一个类似于你的问题,有很好的答案。

#1


1  

You cannot retrieve that data from memcached. If you need it, serialize it with the object you are storing.

您无法从memcached中检索该数据。如果需要,请使用您正在存储的对象对其进行序列化。

Here is a question similar to yours with good answers.

这是一个类似于你的问题,有很好的答案。