Bonjour je voudrai rafraichir un widget chaque jour ,je veux empêcher la cache des navigateur rien ne marche ?
J’ai modifier le html,php le htacess une autre idée ?
php
$expires = 0;
$exp_gmt = gmdate("D, d M Y H:i:s",time()-1000+$expires)." GMT";
$mod_gmt = gmdate("D, d M Y H:i:s",time()-1000)." GMT";
header("Expires: -1");
header("Last-Modified: {$mod_gmt}");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, public, max-age={$expires}");
// HTTP/1.0
header("Pragma: no-cache");
html
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="cache-control" content="no-store" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
htacess
<filesMatch "\.(html|htm|js|css|php)$">
<IfModule mod_expires.c>
ExpiresActive Off
</IfModule>
<IfModule mod_headers.c>
FileETag None
Header unset ETag
Header unset Pragma
Header unset Cache-Control
Header unset Last-Modified
Header set Pragma "no-cache"
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Expires "Mon, 10 Apr 1972 00:00:00 GMT"
</IfModule>
</filesMatch>
rien ne fonctionne sur le cache ??
J’ai modifier le html,php le htacess une autre idée ?
php
$expires = 0;
$exp_gmt = gmdate("D, d M Y H:i:s",time()-1000+$expires)." GMT";
$mod_gmt = gmdate("D, d M Y H:i:s",time()-1000)." GMT";
header("Expires: -1");
header("Last-Modified: {$mod_gmt}");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, public, max-age={$expires}");
// HTTP/1.0
header("Pragma: no-cache");
html
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="cache-control" content="no-store" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
htacess
<filesMatch "\.(html|htm|js|css|php)$">
<IfModule mod_expires.c>
ExpiresActive Off
</IfModule>
<IfModule mod_headers.c>
FileETag None
Header unset ETag
Header unset Pragma
Header unset Cache-Control
Header unset Last-Modified
Header set Pragma "no-cache"
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Expires "Mon, 10 Apr 1972 00:00:00 GMT"
</IfModule>
</filesMatch>
rien ne fonctionne sur le cache ??
Commentaire