diff --git a/nginx.conf b/nginx.conf index bcee0ca..157531d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -5,6 +5,31 @@ events { http { include /etc/nginx/mime.types; default_type application/octet-stream; + # Ensure ETag headers are generated so clients can revalidate quickly + etag on; + + # Gzip compression for text-based / compressible assets + gzip on; # Enable gzip + gzip_comp_level 6; # Balance (1=fastest, 9=slowest). 6 is a good trade-off. + gzip_min_length 1024; # Only compress responses >= 1KB + gzip_vary on; # Add Vary: Accept-Encoding for proxies/CDNs + gzip_proxied any; # Allow compression for all proxied requests + gzip_disable "msie6"; # Disable for very old browsers + # Types to compress (avoid already-compressed formats like images, woff2) + gzip_types + text/plain + text/css + text/javascript + application/javascript + application/x-javascript + application/json + application/xml + application/rss+xml + application/atom+xml + application/vnd.ms-fontobject + font/ttf + font/otf + image/svg+xml; sendfile on; keepalive_timeout 65; @@ -13,17 +38,29 @@ http { listen 80; server_name localhost; + # SPA / root handler location / { root /usr/share/nginx/html; index index.html; try_files $uri $uri/ /index.html; } - # Handle static assets + # HTML should never be aggressively cached so new deployments are seen immediately + location ~* \.html$ { + root /usr/share/nginx/html; + add_header Cache-Control "no-cache, no-store, must-revalidate" always; + add_header Pragma "no-cache" always; + add_header Expires "0" always; + } + + # Handle static assets (non-hashed filenames) with a short cache + revalidation. + # We avoid 'immutable' and long max-age because filenames do not contain content hashes. + # Using a modest max-age allows brief client-side caching while ETag enables fresh checks. location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|ttf|woff|woff2)$ { root /usr/share/nginx/html; - expires 1d; - add_header Cache-Control "public, immutable"; + # Provide a single authoritative Cache-Control header (avoid duplicate via 'expires'). + # max-age=300 (5 minutes) balances freshness and some caching; adjust as needed. + add_header Cache-Control "public, max-age=600, must-revalidate" always; } # Error pages diff --git a/package.json b/package.json index 65441e5..5992cc3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "core-debug-visualizer", "scripts": { "dev": "tsc --watch & npm run serve", - "serve": "tsc && http-server src/public -p 8080 -H \"Cache-Control: no-cache\" -o html/index.html", + "serve": "tsc && http-server src/public -p 8080 -H \"Cache-Control: no-cache\" -o index.html", "build": "tsc" }, "dependencies": { diff --git a/src/public/assets/ui-svgs/fullscreen-close.svg b/src/public/assets/ui-svgs/fullscreen-close.svg new file mode 100644 index 0000000..256fe8f --- /dev/null +++ b/src/public/assets/ui-svgs/fullscreen-close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/assets/ui-svgs/fullscreen-open.svg b/src/public/assets/ui-svgs/fullscreen-open.svg new file mode 100644 index 0000000..369f6f2 --- /dev/null +++ b/src/public/assets/ui-svgs/fullscreen-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/css/styles.css b/src/public/css/styles.css index 1b0f04e..4943f73 100644 --- a/src/public/css/styles.css +++ b/src/public/css/styles.css @@ -236,6 +236,29 @@ body { transform-origin: top right; } +#fullscreen-toggle-button.floating-control { + position: fixed; + right: 16px; + bottom: 16px; + z-index: 1000; + background: #fff; + border: 1px solid #d0d0d0; + border-radius: 10px; + padding: 10px 14px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); + cursor: pointer; + line-height: 1; +} +#fullscreen-toggle-button.floating-control:active, +#fullscreen-toggle-button.floating-control.active { + transform: translateY(1px); +} +#fullscreen-toggle-button #fullscreen-icon { + width: 18px; + height: 18px; + display: block; +} + /* Winner Display */ #win-display-box { diff --git a/src/public/index.html b/src/public/index.html index a3bf944..32c5fd9 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -7,10 +7,9 @@
+ - -