fix(sqlite,browser): resolve SQLite connection pool deadlock, disable stale SW cache, and update BRAIN.md
MindSift CI & Docker Release / Build, Test in Container & Push (push) Failing after 38s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Failing after 38s
This commit is contained in:
1 parent
d6bc2976d9
commit
5c4e130862
8 files changed
+414
-231
No files matched your search
@@ -112,8 +112,19 @@ func (s *Server) Router() http.Handler {
|
||||
path = "index.html"
|
||||
}
|
||||
if _, err := fs.Stat(s.staticFS, path); err != nil {
|
||||
// Never return index.html for missing JS/CSS assets
|
||||
if strings.HasPrefix(path, "assets/") || strings.HasSuffix(path, ".js") || strings.HasSuffix(path, ".css") {
|
||||
http.NotFound(w, req)
|
||||
return
|
||||
}
|
||||
// SPA client-side routing fallback to index.html
|
||||
req.URL.Path = "/"
|
||||
path = "index.html"
|
||||
}
|
||||
if path == "index.html" || path == "sw.js" || path == "manifest.json" {
|
||||
w.Header().Set("Cache-Control", "no-store, no-cache, must-revalidate")
|
||||
w.Header().Set("Pragma", "no-cache")
|
||||
w.Header().Set("Expires", "0")
|
||||
}
|
||||
fileServer.ServeHTTP(w, req)
|
||||
})
|
||||
@@ -126,6 +137,7 @@ func (s *Server) Router() http.Handler {
|
||||
|
||||
func writeJSON(w http.ResponseWriter, status int, data interface{}) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
w.Header().Set("Cache-Control", "no-store, no-cache, must-revalidate")
|
||||
w.WriteHeader(status)
|
||||
_ = json.NewEncoder(w).Encode(data)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user