Upload files to IndexedDB

This commit is contained in:
Magnus Åhall 2026-06-01 14:27:41 +02:00
parent 5bd5ef1f02
commit 8b421ea59e
15 changed files with 539 additions and 99 deletions

View file

@ -66,8 +66,6 @@ func (e *Engine) ReloadTemplates() { // {{{
} // }}}
func (e *Engine) StaticResource(w http.ResponseWriter, r *http.Request) { // {{{
var err error
// URLs with pattern /(css|images)/v1.0.0/foobar are stripped of the version.
// To get rid of problems with cached content in browser on a new version release,
// while also not disabling cache altogether.
@ -83,11 +81,7 @@ func (e *Engine) StaticResource(w http.ResponseWriter, r *http.Request) { // {{{
r.URL.Path = fmt.Sprintf("/%s/%s", comp[1], comp[2])
if e.DevMode {
p := fmt.Sprintf("static/%s/%s", comp[1], comp[2])
_, err = os.Stat(p)
if err == nil {
e.staticLocalFS.ServeHTTP(w, r)
}
e.staticLocalFS.ServeHTTP(w, r)
return
}
}