谷歌地图,缓存问题


Google Map , Cache problem

我正在使用谷歌地图绘制一些折线与标记。一切正常。我正面临缓存的问题。每当我做了一个更改,看到图表,它没有反映的变化第一次,我必须刷新页面2次看到新的变化。

为了避免这种情况,我在页面顶部使用了这个:

<?PHP
header("Cache-Control: no-cache, must-revalidate"); 
header("Expires: Sat, 28 Jul 2007 05:00:00 GMT");
?>

然而,它不工作,因为我刷新了页面几乎2次。

有谁能给我一些建议吗?

谢谢扎克

把这个放在脚本的顶部怎么样?它将在每次访问脚本时更改脚本的URL。这应该可以防止浏览器缓存…

if (!isset($_GET['time'])) {
    // url of current page, with an added timestamp
    $host  = $_SERVER['HTTP_HOST'];
    $page = $_SERVER['PHP_SELF'];
    $url = "http://$host$page?time=".time();
    // redirect back to this same page, but changing the URL 
    // to include the current unix timestamp
    header('Location: '.$url);
    exit;
}