0

I used this config in my virtual host in Apache 2.4 on Ubuntu 16:

<VirtualHost>
       ...

       CacheQuickHandler on
       CacheLock on
       CacheLockPath /tmp/mod_cache-lock
       CacheLockMaxAge 5
       CacheIgnoreHeaders Set-Cookie

       <Location />
          CacheEnable disk
          CacheHeader on
          CacheDefaultExpire 800
          CacheMaxExpire 64000
          CacheIgnoreNoLastMod On
       </Location>
</VirtualHost>

I have enabled the modules:

sudo a2enmod cache
sudo a2enmod cache_disk
sudo a2enmod expires
sudo a2enmod headers

And restarted apache without any errors. After clearing my browsers cache and browsing my site I expect content to apear under

/var/cache/apache2/mod_cache_disk/

But this is what I see all the time:

root@server:~# ls -la /var/cache/apache2/mod_cache_disk/
total 8
drwxr-xr-x 2 www-data www-data 4096 Apr 18 11:29 .
drwxr-xr-x 3 root     root     4096 Jun 29 08:07 ..

I don't seem to be caching anything?!

When I add logging I get a bunch of minus signs "-" using LogFormat "%{cache-status}e ". The minus signs increase in number, but what does it mean?

Log files:

root@server:~# ls -l /etc/apache2/logs/
total 4
-rw-r--r-- 1 root root 1059 Aug 26 04:47 cache.log
-rw-r--r-- 1 root root    0 Aug 26 03:53 cached-requests.log
-rw-r--r-- 1 root root    0 Aug 26 03:53 invalidated-requests.log
-rw-r--r-- 1 root root    0 Aug 26 03:53 revalidated-requests.log
-rw-r--r-- 1 root root    0 Aug 26 03:53 uncached-requests.log

1 Answer 1

0

Ok I managed to get it all working, but I had to set CacheQuickHandler to off to see the cached content.. Anyone knows why? I keep it off as I don't know wheater the caching works otherwise.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .