mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
add caching rules, tell client caching for 1 year, but no caching for index.html
This commit is contained in:
parent
a40ae18f2b
commit
686d1749e9
@ -51,6 +51,12 @@ server {
|
||||
rewrite ^/vue/?(.*)$ /$1 permanent;
|
||||
}
|
||||
|
||||
# caching rules for assets
|
||||
location ~* \.(?:js|css|woff2?|ttf|otf|eot|jpg|jpeg|png|gif|svg|webp|ico)$ {
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Frontend (default)
|
||||
location / {
|
||||
|
||||
@ -59,6 +65,11 @@ server {
|
||||
root $PROJECT_ROOT/frontend/build/;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html = 404;
|
||||
|
||||
# don't cache index.html
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires 0;
|
||||
|
||||
access_log $GRADIDO_LOG_PATH/nginx-access.frontend.log gradido_log;
|
||||
error_log $GRADIDO_LOG_PATH/nginx-error.frontend.log warn;
|
||||
@ -119,6 +130,11 @@ server {
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html = 404;
|
||||
|
||||
# don't cache index.html
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires 0;
|
||||
|
||||
access_log $GRADIDO_LOG_PATH/nginx-access.admin.log gradido_log;
|
||||
error_log $GRADIDO_LOG_PATH/nginx-error.admin.log warn;
|
||||
}
|
||||
|
||||
@ -36,6 +36,12 @@ server {
|
||||
rewrite ^/vue/?(.*)$ /$1 permanent;
|
||||
}
|
||||
|
||||
# caching rules for assets
|
||||
location ~* \.(?:js|css|woff2?|ttf|otf|eot|jpg|jpeg|png|gif|svg|webp|ico)$ {
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Frontend (default)
|
||||
location / {
|
||||
#limit_req zone=frontend burst=40 nodelay;
|
||||
@ -44,6 +50,11 @@ server {
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html = 404;
|
||||
|
||||
# don't cache index.html
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires 0;
|
||||
|
||||
access_log $GRADIDO_LOG_PATH/nginx-access.frontend.log gradido_log;
|
||||
error_log $GRADIDO_LOG_PATH/nginx-error.frontend.log warn;
|
||||
}
|
||||
@ -103,6 +114,11 @@ server {
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html = 404;
|
||||
|
||||
# don't cache index.html
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires 0;
|
||||
|
||||
access_log $GRADIDO_LOG_PATH/nginx-access.admin.log gradido_log;
|
||||
error_log $GRADIDO_LOG_PATH/nginx-error.admin.log warn;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user