Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx how to disable cache for static files like CSS #529

Open
ghost opened this issue Oct 12, 2022 · 2 comments
Open

Nginx how to disable cache for static files like CSS #529

ghost opened this issue Oct 12, 2022 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 12, 2022

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");
@csandanov
Copy link
Member

You can set NGINX_DISABLE_CACHING=1 env var for nginx

@SimonasJurksa
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants