Sequential versioning instead of semantic, since it wasn't used correctly anyway.
This commit is contained in:
parent
7afe8316a9
commit
005827e65a
9
main.go
9
main.go
@ -20,7 +20,7 @@ import (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
)
|
)
|
||||||
|
|
||||||
const VERSION = "v0.3.0";
|
const VERSION = "v6";
|
||||||
const LISTEN_HOST = "0.0.0.0";
|
const LISTEN_HOST = "0.0.0.0";
|
||||||
const DB_SCHEMA = 10
|
const DB_SCHEMA = 10
|
||||||
|
|
||||||
@ -112,7 +112,12 @@ func staticHandler(w http.ResponseWriter, r *http.Request) {// {{{
|
|||||||
// To get rid of problems with cached content in browser on a new version release,
|
// To get rid of problems with cached content in browser on a new version release,
|
||||||
// while also not disabling cache altogether.
|
// while also not disabling cache altogether.
|
||||||
log.Printf("static: %s", r.URL.Path)
|
log.Printf("static: %s", r.URL.Path)
|
||||||
rxp := regexp.MustCompile("^/(css|images|js|fonts)/v[0-9]+\\.[0-9]+\\.[0-9]+/(.*)$")
|
if r.URL.Path == "/favicon.ico" {
|
||||||
|
static.ServeHTTP(w, r)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
rxp := regexp.MustCompile("^/(css|images|js|fonts)/v[0-9]+/(.*)$")
|
||||||
if comp := rxp.FindStringSubmatch(r.URL.Path); comp != nil {
|
if comp := rxp.FindStringSubmatch(r.URL.Path); comp != nil {
|
||||||
r.URL.Path = fmt.Sprintf("/%s/%s", comp[1], comp[2])
|
r.URL.Path = fmt.Sprintf("/%s/%s", comp[1], comp[2])
|
||||||
static.ServeHTTP(w, r)
|
static.ServeHTTP(w, r)
|
||||||
|
Loading…
Reference in New Issue
Block a user