Çünkü tarayıcı önbelleği PHP Aplikasyon güncellemeleri ile sorun

0 Cevap php

Biz PHP bir uygulama var. Biz güncellemeleri ve bu uygulamada değişiklik yaptığınızda sorun gelir. Bazen, kullanıcıların çünkü tarayıcı önbelleği (HTML and javascript are mainly changed) uygulamasının son sürümünü alamadım. Biz bu konuda fark ettikten sonra, (Biz herhangi bir HTML önce çalıştırmak tarayıcısına gönderilir) bizim uygulamada sonraki kodu dahil başardık

function clean_cache(){
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
    header("Cache: no-cache");
    header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
}   

But still we have some users that have older versions of our application. We read that a possible solution is to use a javascript asking the server via ajax if there is an update. If so, force a reload. If this is the best way to solve our problem : How can we implement this solution? If you have any other possible solution we will be very happy to know it.

Teşekkürler

0 Cevap