If Apache cache doesn’t work properly for your website, you need to delete Apache cache or clear Apache cache. If it still doesn’t work, then here’s how to completely disable Apache Cache for your website.
1. Open httpd.conf
Open httpd.conf
with your favorite editor, make sure mod_rewrite
and mod_headers
are loaded.
1 | LoadModule rewrite_module modules/mod_rewrite.so |
2. Disable Apache Cache
Create a config file in the directory conf/extra/
, for example httpd-cache.conf
.
Let’s say you want to disable caching html, js, css files only, then add the following lines to your httpd-cache.conf
file.
1 | #Initialize mod_rewrite |
If you want to also stop caching other file types such as pdf, jpg, etc. include them in line #3 above.
3. Include this file in httpd.conf
Include this file in httpd.conf
:
1 | # Disable cache |
4. Restart Apache server
Restart Apache server to applay changes.