How to disable apache cache

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
dietpiOK
Posts: 76
Joined: Thu Mar 16, 2017 9:33 am

How to disable apache cache

Post by dietpiOK »

Hi,

I am running the LAMP stack on my dietpi raspi. All files from the webserver will use a mounted NAS drive for serving any website request.
The issue that I am currently facing is that when I do only change very small parts of any php file, like only a couple of bytes, the results will not be served to the clients from my apache.
I figured out that the NAS will not do any caching but obviouls my apache will do so. Can any one here tell me how to disable caching in the apache configuration? I found some hints on the web like "mod-cache" and "CacheDisable" but I do not know where to apply these kind of changes. What are the defaults for caching from a dietpi based apache installation and into which file do I need to apply my own configuration?

Best regards,
Olaf
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: How to disable apache cache

Post by Fourdee »

dietpiOK wrote:Hi,

I am running the LAMP stack on my dietpi raspi. All files from the webserver will use a mounted NAS drive for serving any website request.
The issue that I am currently facing is that when I do only change very small parts of any php file, like only a couple of bytes, the results will not be served to the clients from my apache.
I figured out that the NAS will not do any caching but obviouls my apache will do so. Can any one here tell me how to disable caching in the apache configuration? I found some hints on the web like "mod-cache" and "CacheDisable" but I do not know where to apply these kind of changes. What are the defaults for caching from a dietpi based apache installation and into which file do I need to apply my own configuration?

Best regards,
Olaf
Hi Olaf,

DietPi installs APC and OPcache for all webserver stacks and PHP. You'll need to disable those modules, simply remove the files:

Code: Select all

rm /etc/php5/mods-available/apcu.ini
rm /etc/php5/mods-available/opcache.ini
dietpi-services restart
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
dietpiOK
Posts: 76
Joined: Thu Mar 16, 2017 9:33 am

Re: How to disable apache cache

Post by dietpiOK »

Thanks for that reply. I really do not understand the two files and what they are exactly good for.
Is it also possible to just exclude caching for certain URLs?
And if I want to reenable the caching at a later time, how do I get back?
Post Reply