After making a change to our Website (css, js, jpg, font, etc.), to make the changes immediate you need to disable the Cache.
With this code at the end of our .htaccess file, we forced a New Browser Session not to cache any files in its cache.
Please note: any previous session will remain in cache and you must clear the Browser Cache manually.
# DISABLE CACHING
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>
<FilesMatch "\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|mp3|mp4|png|pdf|swf|txt)$">
<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 "Thu, 1 Jan 1970 00:00:00 GMT"
</IfModule>
</FilesMatch>
Music and Electronic Devices Designer. Drum and Bass Addict. Creative Mind as Lifestyle. Cat in past Life. Soccer, Ice Hockey and Snowboard Lover. Marxist.
Sono Il Re sul Carro Danzante. Attraversando La Città Getto Via I Coriandoli Della Vostra Tristezza Regalando Passione Ed Estasi Nei Vostri Occhi. Follow Trony on: FusoElektronique
|
Facebook
|
Twitter
|
Google+
|
Soundcloud
Forum ~ Web Server: How to disable caching using .htaccess ~ FusoElektroniquePage 1 ~ Title: Web Server: How to disable caching using .htaccess. Category: Computers - WebMastering - Consolle (Design's Factory). Published by: Trony. Date: 28 October 2020. Descrption: After making a change to our Website (css, js, jpg, font, etc.), to make th...2020-10-28T12:55:28-05:00Trony