wodby / docker4drupal

Docker-based Drupal stack
https://wodby.com/docker4drupal
MIT License
1.24k stars 535 forks source link

Nginx serves old files #98

Closed gambry closed 7 years ago

gambry commented 7 years ago

My setup makes use of mariadb, php and nginx services only.

When working on static files (CSS, JS) I don't see the updates when accessing the files through the webserver. If I read the files from the container file system I can see the changes, but if I GET the same files from HTTP (browser or wget from within nginx container itself) served files are still old ones.

The static files I'm working on are assets of a custom D8 module, so inside the path /modules/custom/my-module/[css|js]/myfile.[css|js] . I can't confirm the problem happens for themes too, but as nobody had this issue before I'm presuming it doesn't.

I'm assuming this is something related to nginx cache.

Any clue?

csandanov commented 7 years ago

What is your nginx image tag?

gambry commented 7 years ago

I tried with both wodby/drupal-nginx:1.10-1.1.0 (currently in use) and wodby/drupal-nginx:8-1.10-2.0.0.

I've also tried to use the NGINX_STATIC_CONTENT_EXPIRES variable on both, but apparently is not supported as I didn't see any change.

pprishchepa commented 7 years ago

@gambry try to use wodby/drupal-nginx:7-1.10-2.0.0 with env var NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: off.

d4d 2.0 nginx vhost config template https://github.com/wodby/drupal-nginx/blob/master/8/1.10/drupal.conf.tpl#L47.

gambry commented 7 years ago

try to use wodby/drupal-nginx:7-1.10-2.0.0

Why 7? Did you mean wodby/drupal-nginx:8-1.10-2.0.0 ?

pprishchepa commented 7 years ago

@gambry sorry, yes wodby/drupal-nginx:8-1.10-2.0.0

gambry commented 7 years ago

I've been monitoring the issue for few days and with the new image version + NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: off the issue seems resolved.

Thanks a lot!