From 1cf8882470d7e0199fef6f538c7016f64de17847 Mon Sep 17 00:00:00 2001 From: Patrick Schwarz Date: Thu, 1 Feb 2024 20:24:18 +0100 Subject: [PATCH] Add some readme --- README.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 README.txt diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..b625aa2 --- /dev/null +++ b/README.txt @@ -0,0 +1,45 @@ +# Website des Chaostreff Backnang + +## nginx config +``` + # Charset + charset UTF-8; + + # Enable gzip but do not remove ETag headers + gzip on; + gzip_vary on; + gzip_comp_level 4; + gzip_min_length 256; + gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; + gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; + + # Remove X-Powered-By, which is an information leak + fastcgi_hide_header X-Powered-By; + + # Site-Icon Rules + rewrite ^/favicon\.ico$ img/favicon.ico redirect; + + # Caching + location ~* \.(?:jpg|gif|png|ico|gz|svg|css|js|pdf|woff|woff2)$ { + access_log off; + log_not_found off; + expires 1w; + add_header Cache-Control "public"; + add_header Cache-Control "max-age=604800"; + gzip_static on; + } + + index index.html index.htm; +``` + +## Minify resources + +``` +for file in `find -name "*.js" -not -name "*.min.js" -not -name "sw.js" -type f` ; do F_NAME=$(dirname ${file})/$(basename ${file} .js); uglifyjs ${file} > ${F_NAME}.min.js; done + +for file in `find -name "*.css" -not -name "*.min.css" -type f`; do F_NAME=$(dirname ${file})/$(basename ${file} .css); cleancss ${file} > ${F_NAME}.min.css; done + +optipng -o7 -zm1-9 -strip all img/*.png + +for file in `find -name "*.min.css" -o -name "*.min.js" -o -name "*.svg" -type f`; do zopfli --i1000 ${file}; done +``` \ No newline at end of file