Apache, PHP, WordPress caching issue in Docker container

I am on OS X using the Virtualbox docker driver. Using the official WordPress image, I configure the volume from my local machine to display in the container

/Users/gezimhome/projects/zr/src /var/www/html/wp-content/plugins/zr

When I update the files on the host, they appear in the container, but the changes do not appear on the website until a few minutes later. I suspect this could be Apache caching, as I don't have plugins for WordPress caching.

Update . I have not tried other file types. PHP files are not updated when the site loads in the browser (or even when using curl ).

Update 2 . Here is the file . htaccess . Here is the docker docker information

+5
source share
1 answer

Turns out it was called opcache in PHP. Opcache was included in Wordpress docker as follows:

 RUN { \ echo 'opcache.memory_consumption=128'; \ echo 'opcache.interned_strings_buffer=8'; \ echo 'opcache.max_accelerated_files=4000'; \ echo 'opcache.revalidate_freq=60'; \ echo 'opcache.fast_shutdown=1'; \ echo 'opcache.enable_cli=1'; \ } > /usr/local/etc/php/conf.d/opcache-recommended.ini 

So, I created a new docker image for wordpress that disables caching . Essentially this:

 FROM wordpress:latest RUN rm -rf /usr/local/etc/php/conf.d/opcache-recommended.ini 
+14
source

Source: https://habr.com/ru/post/1242582/


All Articles