Improve performance on poor connections: local assets, gzip, caching

- Replace Tailwind CDN (~350KB) with purged local CSS (~22KB)
- Replace htmx unpkg CDN with local static file
- Add Gzip middleware (standard library, sync.Pool) for all responses
- Add Cache-Control: public, max-age=3600 for /static/* assets
- Reduce status polling interval from 5s to 30s
- Add scripts/build-css.sh for CSS regeneration after template changes
- Document in bible-local/operations.md and history.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-03-14 14:51:21 +03:00
parent c53c484bde
commit df5be91353
14 changed files with 1220 additions and 4 deletions

1
web/static/js/htmx.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
web/static/tailwind.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -5,8 +5,9 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{template "title" .}}</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
<link rel="stylesheet" href="/static/tailwind.min.css">
<link rel="stylesheet" href="/static/app.css">
<script src="/static/js/htmx.min.js"></script>
<style>
.htmx-request { opacity: 0.5; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@@ -163,7 +164,7 @@
document.addEventListener('DOMContentLoaded', function () {
refreshSystemStatus();
setInterval(refreshSystemStatus, 5000); // 5 second polling
setInterval(refreshSystemStatus, 30000); // 30 second polling
});
</script>
</body>