tangled
alpha
login
or
join now
brookjeynes.dev
/
shelf
3
fork
atom
Discover books, shows, and movies at your level. Track your progress by filling your Shelf with what you find, and share with other language learners. *No dusting required.
shlf.space
3
fork
atom
overview
issues
pulls
pipelines
*:fmt
Signed-off-by: brookjeynes <me@brookjeynes.dev>
brookjeynes.dev
1 month ago
9620cdcd
7d5cb72d
+5
-5
1 changed file
expand all
collapse all
unified
split
internal
server
static.go
+5
-5
internal/server/static.go
···
8
8
"shelf.app/static"
9
9
)
10
10
11
11
-
func (s *Server) HandleStatic () http.Handler {
12
12
-
var staticHandler http.Handler;
11
11
+
func (s *Server) HandleStatic() http.Handler {
12
12
+
var staticHandler http.Handler
13
13
14
14
if s.config.Core.Dev {
15
15
fileSystem := http.Dir("./static/files")
···
31
31
32
32
func Cache(h http.Handler) http.Handler {
33
33
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
34
34
-
path:=strings.Split(r.URL.Path, "?")[0]
34
34
+
path := strings.Split(r.URL.Path, "?")[0]
35
35
36
36
-
if strings.HasSuffix(path, ".js"){
36
36
+
if strings.HasSuffix(path, ".js") {
37
37
w.Header().Set("Cache-Control", "public, max-age=31536000, immutable")
38
38
-
}else{
38
38
+
} else {
39
39
w.Header().Set("Cache-Control", "public, max-age=3600")
40
40
}
41
41