Page 1 of 1

cant control cache

PostPosted: 23. November 2015 06:27
by anyandallart
I've tried to change the cache settings in httpd.conf, and in htaccess, and for some reason my localhost is still serving cached version of my html pages.

Can anyone please help?

These are my httpd.conf settings:

<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, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>
CacheDisable /local_files

These are my htaccess settings:

<FilesMatch "\.(html|htm|php|cgi|pl|asp|aspx|js|css)$">
Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"
</FilesMatch>

Re: cant control cache

PostPosted: 23. November 2015 06:58
by Altrea
Browser cache settings?

Re: cant control cache

PostPosted: 23. November 2015 07:30
by anyandallart
Okay so this is the only thing that worked for me.

I needed to add this line to my httpd-vhosts.conf

AllowOverride all

It allowed what I have in htaccess to override the server defaults. I think it could also work putting it somewhere in httpd.conf, however it only seems to work if i specify it for that specific directory or for all directories in general

This is a snippet of part of the new httpd-vhosts.conf that works with AllowOverride all:

<VirtualHost *>
DocumentRoot "D:\myDirectory"
ServerName mydirectory
<Directory "D:\myDirectory">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>