perf(web): use thumbnails instead of full sized images
This commit is contained in:
parent
eaa7c2f2ce
commit
083eac3fee
@ -218,6 +218,9 @@ func main() {
|
|||||||
http.StripPrefix("/files", tfm_fs).ServeHTTP(w, r)
|
http.StripPrefix("/files", tfm_fs).ServeHTTP(w, r)
|
||||||
}))
|
}))
|
||||||
http.Handle("/thumbs/", Auth(func(w http.ResponseWriter, r *http.Request) {
|
http.Handle("/thumbs/", Auth(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
thumb_path := strings.Split(r.URL.Path, "/")
|
||||||
|
thumb_path[len(thumb_path)-1] = ".thumb-" + thumb_path[len(thumb_path)-1]
|
||||||
|
r.URL.Path = strings.Join(thumb_path, "/")
|
||||||
http.StripPrefix("/thumbs", tfm_fs).ServeHTTP(w, r)
|
http.StripPrefix("/thumbs", tfm_fs).ServeHTTP(w, r)
|
||||||
}))
|
}))
|
||||||
log.Println("Running...")
|
log.Println("Running...")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user