docker4drupal
docker4drupal copied to clipboard
Nginx how to disable cache for static files like CSS
Describe your issue
When nginx serves CSS files I get max-age=31536000, public how to make this to be "no-cache" like I can do to php files with
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
You can set NGINX_DISABLE_CACHING=1 env var for nginx
Having dev env on my localhost using wodby/nginx for me worked:
NGINX_DISABLE_CACHING: 1
NGINX_NO_DEFAULT_HEADERS: 1
NGINX_STATIC_EXPIRES: 0
NGINX_STATIC_EXT_REGEX: cur|jpe?g|gif|htc|png|xml|otf|ttf|eot|woff|woff2|mp4|svgz|ogg|ogv|pdf|pptx?|zip|tgz|gz|rar|bz2|doc|xls|exe|tar|mid|midi|wav|bmp|rtf|txt|map|webp
Providing only NGINX_DISABLE_CACHING=1 did not work.