Use /scripts to avoid CF caching
This commit is contained in:
parent
cbdf8c0059
commit
f1767f034e
14
assets.go
14
assets.go
@ -11,17 +11,19 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
// Scripts
|
||||||
|
js := components.JS()
|
||||||
|
|
||||||
|
app.Get("/scripts", func(ctx *aero.Context) string {
|
||||||
|
ctx.SetResponseHeader("Content-Type", "application/javascript")
|
||||||
|
return js
|
||||||
|
})
|
||||||
|
|
||||||
// Web manifest
|
// Web manifest
|
||||||
app.Get("/manifest.json", func(ctx *aero.Context) string {
|
app.Get("/manifest.json", func(ctx *aero.Context) string {
|
||||||
return ctx.JSON(app.Config.Manifest)
|
return ctx.JSON(app.Config.Manifest)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Scripts
|
|
||||||
app.Get("/scripts.js", func(ctx *aero.Context) string {
|
|
||||||
ctx.SetResponseHeader("Content-Type", "application/javascript")
|
|
||||||
return components.JS()
|
|
||||||
})
|
|
||||||
|
|
||||||
// Favicon
|
// Favicon
|
||||||
app.Get("/favicon.ico", func(ctx *aero.Context) string {
|
app.Get("/favicon.ico", func(ctx *aero.Context) string {
|
||||||
return ctx.TryWebP("images/brand/64", ".png")
|
return ctx.TryWebP("images/brand/64", ".png")
|
||||||
|
@ -13,7 +13,7 @@ component Layout(app *aero.Application, user *arn.User, content string)
|
|||||||
main#content.fade!= content
|
main#content.fade!= content
|
||||||
|
|
||||||
LoadingAnimation
|
LoadingAnimation
|
||||||
script(src="/scripts.js")
|
script(src="/scripts")
|
||||||
|
|
||||||
component LoadingAnimation
|
component LoadingAnimation
|
||||||
#loading.sk-cube-grid.fade
|
#loading.sk-cube-grid.fade
|
||||||
|
8
tests.go
8
tests.go
@ -35,6 +35,10 @@ func init() {
|
|||||||
"/forum/general",
|
"/forum/general",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.Test("/search/:term", []string{
|
||||||
|
"/search/Dragon Ball",
|
||||||
|
})
|
||||||
|
|
||||||
// API
|
// API
|
||||||
app.Test("/api/anime/:id", []string{
|
app.Test("/api/anime/:id", []string{
|
||||||
"/api/anime/1",
|
"/api/anime/1",
|
||||||
@ -72,6 +76,10 @@ func init() {
|
|||||||
"/api/nicktouser/Akyoto",
|
"/api/nicktouser/Akyoto",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.Test("/api/searchindex/:id", []string{
|
||||||
|
"/api/searchindex/Anime",
|
||||||
|
})
|
||||||
|
|
||||||
// Images
|
// Images
|
||||||
app.Test("/images/avatars/large/:file", []string{
|
app.Test("/images/avatars/large/:file", []string{
|
||||||
"/images/avatars/large/4J6qpK1ve.webp",
|
"/images/avatars/large/4J6qpK1ve.webp",
|
||||||
|
Loading…
Reference in New Issue
Block a user