File:test_apc.php
<?php if (!apc_exists('str')){ $str = "I am cached for 5 seconds at: ".date('H:i:s'); apc_store('str', $str, 5); echo apc_fetch('str'); } else{ echo apc_fetch('str'); } echo "<p><a href='test_apc_delete.php'>Delete</a> string form cache</p>"; ?>
File:test_apc_delete.php
<?php if (apc_exists('str')){ if(apc_delete('str'))
echo "Key `str` is deleted by <i>apc_delete()</i> function."; } else { echo "Key `str` has exipred."; } ?>References are at APC offical page.
No comments:
Post a Comment