17

I put only index.html in /var/www/html. The page doesn't update after I changed the contents of index.html and reload.

I already disable cache_module in httpd.conf like this below.

# LoadModule cache_module modules/mod_cache.so
# LoadModule disk_cache_module modules/mod_disk_cache.so
1
  • Where is httpd.conf? I can't find it anywhere in /etc or /var on Ubuntu. Commented Jan 6, 2019 at 18:41

1 Answer 1

25

if you are using htaccess then you can do like

#Initialize mod_rewrite
RewriteEngine On
<FilesMatch "\.(html|htm|js|css)$">
  FileETag None
  <IfModule mod_headers.c>
    Header unset ETag
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "Wed, 12 Jan 1980 05:00:00 GMT"
  </IfModule>
</FilesMatch>
Sign up to request clarification or add additional context in comments.

9 Comments

Thank you! But where do I put this settings? I put it the end of httpd.conf and nothing changed..
create a .htaccess file under root directory where you have uploaded your files in server and put above lines inside .htaccess file
I did that but the result is not change. I also restarted apache.
check if you have mod_rewrite enable in the server with the hosting company. also check I have edited answer above
That .htaccess does not work for me. Also, my apache2.conf file did not contain EnableSendfile on, but I added EnableSendfile off and it doesn't work, it's still caching.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.