Eğer cache verilerin /cache klasöründe ise bu kodlar ile yapabilirsin.
cache-sil.php
<?php
$dizin = 'cache/';
if($_GET['temiz']){
if ($kaynak = opendir($dizin)) {
while (false !== ($file = readdir($kaynak))) {
if ($file != "." AND $file != ".." AND $file != "index.html" AND file !=".htaccess") {
unlink($dizin."/".$file);
}}}}
$dizinac = @opendir($dizin) or die('Dizin açılamadı!');
$toplamdosya = 0;
while ($eleman = @readdir($dizinac)) {
if (gettype($eleman) != 'boolean' && !is_dir($eleman)) {
$toplamdosya++;
$dosyaliste .= "<li><a href=\"$dizin/$eleman\">".ucwords($eleman)."</a></li>\n"; } }
@closedir($dizinac); ?>
<html>
<head>
<title>Cache Temizleme</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META NAME="ROBOTS" CONTENT="NOINDEX">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="Cache-Control" content="no-cache">
<style type="text/css">
<!--
body {background:#000;}
body,td,th {font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 12px;color: #fff;}
#container {width:712px;margin:0 auto; text-align:center;background:#242424;}
a {color: #595b5b; text-decoration: none;}
a:visited {color:#595b5b;text-decoration: none;}
a:hover {color:#fff;text-decoration: underline;}
a:active {text-decoration: none;}
.button {float:right;width:130px;height:20px;background:#111;padding:1px 2px 0 2px;color:#fff; border:1px solid #0f0f0f;_border:none;box-shadow:0px 2px 2px 0px #000; text-shadow: -1px$
.ekleme {float:left;width:702px;height:30px;background:#f30;padding:5px;color:#fff;text-shadow: -1px -1px 0 #000; text-transform:uppercase;}
.eklemem {float:left;width:702px;height:auto;background:#242424;padding:5px;color:#fff;text-shadow: -1px -1px 0 #000; }
.eklemem ul{float:left;width:702px;height:auto;}
.eklemem li {border-bottom:#111 solid 1px; padding:5px;}
-->
</style>
</head>
<body>
<div id="container">
<div class="ekleme">
<b><?=$dizin?></b> Klasöründe <b><?=$toplamdosya?></b> tane cache'lenmiş dosya var.</div>
<div class="button">
<a href="?temiz=ok">Hemen SiL</a></div>
<ul class="eklemem">
<?=$dosyaliste?>
</ul>
</div>
</body>
</html>
<? unset($dizin, $dizinac, $toplamdosya, $eleman, $dosyaliste);