mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2025-12-10 13:49:39 +05:00
Use minified hls.js; bigger caching for assets
This commit is contained in:
@@ -21,7 +21,7 @@ FROM scratch
|
||||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=build /build/assets /assets
|
||||
COPY --from=build /build/app /app
|
||||
COPY --from=node /hls.js/node_modules /node_modules
|
||||
COPY --from=node /hls.js/node_modules/hls.js/dist/hls.light.min.js /node_modules/hls.js/dist/hls.light.min.js
|
||||
|
||||
EXPOSE 4664
|
||||
|
||||
|
||||
4
main.go
4
main.go
@@ -38,8 +38,8 @@ func main() {
|
||||
}
|
||||
app.Use(compress.New(compress.Config{Level: compress.LevelBestSpeed}))
|
||||
|
||||
app.Static("/", "assets", fiber.Static{Compress: true, MaxAge: 3600})
|
||||
app.Static("/js/hls.js/", "node_modules/hls.js/dist", fiber.Static{Compress: true, MaxAge: 14400})
|
||||
app.Static("/", "assets", fiber.Static{Compress: true, MaxAge: 3600}) // 1hour
|
||||
app.Static("/js/hls.js/", "node_modules/hls.js/dist", fiber.Static{Compress: true, MaxAge: 28800}) // 8 hours
|
||||
|
||||
app.Get("/search", func(c *fiber.Ctx) error {
|
||||
prefs, err := preferences.Get(c)
|
||||
|
||||
@@ -15,7 +15,7 @@ templ TrackHeader(prefs cfg.Preferences, t sc.Track) {
|
||||
<meta name="og:image" content={ t.Artwork }/>
|
||||
<link rel="icon" type="image/x-icon" href={ t.Artwork }/>
|
||||
if *prefs.Player == cfg.HLSPlayer {
|
||||
<script src="/js/hls.js/hls.light.js"></script>
|
||||
<script src="/js/hls.js/hls.light.min.js"></script>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user