Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php APCu不会自动从缓存列表中删除过期缓存_Php_Apc_Apcu - Fatal编程技术网

Php APCu不会自动从缓存列表中删除过期缓存

Php APCu不会自动从缓存列表中删除过期缓存,php,apc,apcu,Php,Apc,Apcu,使用以下命令存储apcu缓存: apcu_store('test1', 'aaa', 2); 应该在2秒后过期,但是当我使用 apcu_cache_info(); 我仍然通过“缓存列表”看到它,但无法再通过apcu获取访问它 如果我使用 apcu_clear_cache(); 正在删除所有缓存,但我只需要删除旧的过期缓存如何修复 Array ( [num_slots] => 4099 [ttl] => 0 [num_hits] => 0

使用以下命令存储apcu缓存:

apcu_store('test1', 'aaa', 2);
应该在2秒后过期,但是当我使用

apcu_cache_info();
我仍然通过“缓存列表”看到它,但无法再通过apcu获取访问它

如果我使用

apcu_clear_cache(); 
正在删除所有缓存,但我只需要删除旧的过期缓存如何修复

Array
(
    [num_slots] => 4099
    [ttl] => 0
    [num_hits] => 0
    [num_misses] => 4
    [num_inserts] => 1
    [num_entries] => 1
    [expunges] => 0
    [start_time] => 1599489252
    [mem_size] => 160
    [memory_type] => mmap
    [cache_list] => Array
        (
            [0] => Array
                (
                    [info] => test1
                    [ttl] => 2
                    [num_hits] => 0
                    [mtime] => 1599489289
                    [creation_time] => 1599489289
                    [deletion_time] => 0
                    [access_time] => 1599489289
                    [ref_count] => 0
                    [mem_size] => 160
                )

        )

    [deleted_list] => Array
        (
        )

    [slot_distribution] => Array
        (
            [699] => 1
        )

)

当我使用apcu查看所有可能的函数时,您需要使用
apcu\u delete('test1')
将其从apcu中完全删除