Skip to content

Commit bd59888

Browse files
committed
Do not show expired apc items by default
1 parent 0168966 commit bd59888

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cache.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,12 @@ function sort_list(&$list) {
245245
</label>
246246
</form>
247247
<form action="?" method="GET">
248-
<label>Key(s):</label>
249-
<input name="selector" type="text" value="" placeholder=".*" />
248+
<label>Key(s):
249+
<input name="selector" type="text" value="" placeholder=".*" />
250+
</label>
250251
<button type="submit" name="action" value="apc_select">Select</button>
251252
<button type="submit" name="action" value="apc_delete">Delete</button>
253+
<label><input type="checkbox" name="apc_show_expired" <?=isset($_GET['apc_show_expired'])?'checked="checked"':''?> />Show expired</label>
252254
</form>
253255
</div>
254256
<?php if( isset( $_GET['action'] ) && $_GET['action'] == 'apc_view' ): ?>
@@ -276,7 +278,7 @@ function sort_list(&$list) {
276278

277279
<tbody>
278280
<?php foreach( sort_list($apc['cache']['cache_list']) as $item ):
279-
if( !preg_match(get_selector(), $item['key']) ) continue;?>
281+
if( !preg_match(get_selector(), $item['key']) || ( !isset( $_GET['apc_show_expired'] ) && $item['mtime'] + $item['ttl'] < time() ) ) continue;?>
280282
<tr>
281283
<td><?=$item['key']?></td>
282284
<td><?=$item['nhits']?></td>

0 commit comments

Comments
 (0)