Désactiver le cache du site web

Skip to main content
Du bist hier:
Drucken

Désactiver le cache du site web

Si votre application web ne propose pas de paramètres de cache dans les paramètres, vous pouvez désactiver le cache de votre page web avec un fichier .htaccess. Pour ce faire, créez un fichier .htaccess dans le dossier racine de votre site web via FTP ou le gestionnaire de fichiers ou ajoutez la valeur suivante au fichier .htaccess existant afin de désactiver le cache de manière permanente et d’en informer tous les navigateurs :

[code lang=”php”]
<span class="hljs-comment"># DISABLE CACHING</span>
<span class="hljs-section"><IfModule mod_headers.c></span>
<span class="hljs-attribute"><span class="hljs-nomarkup">Header</span></span> set Cache-Control <span class="hljs-string">"no-cache, no-store, must-revalidate"</span>
<span class="hljs-attribute"><span class="hljs-nomarkup">Header</span></span> set Pragma <span class="hljs-string">"no-cache"</span>
<span class="hljs-attribute"><span class="hljs-nomarkup">Header</span></span> set Expires 0
<span class="hljs-section"></IfModule></span>
[/code]

Related Post