mirror of
https://github.com/usememos/memos.git
synced 2025-11-10 17:31:33 +08:00
chore: remove internal frontend cache
This commit is contained in:
parent
81e40d9b18
commit
d794e6db76
1 changed files with 1 additions and 14 deletions
|
|
@ -35,20 +35,7 @@ func (*FrontendService) Serve(_ context.Context, e *echo.Echo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Route to serve the main app with HTML5 fallback for SPA behavior.
|
// Route to serve the main app with HTML5 fallback for SPA behavior.
|
||||||
e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
|
e.Use(middleware.StaticWithConfig(middleware.StaticConfig{
|
||||||
return func(c echo.Context) error {
|
|
||||||
// Skip API routes.
|
|
||||||
if apiSkipper(c) {
|
|
||||||
return next(c)
|
|
||||||
}
|
|
||||||
// Skip `/index.html`.
|
|
||||||
if c.Path() == "/index.html" {
|
|
||||||
return next(c)
|
|
||||||
}
|
|
||||||
c.Response().Header().Set(echo.HeaderCacheControl, "max-age=31536000, immutable")
|
|
||||||
return next(c)
|
|
||||||
}
|
|
||||||
}, middleware.StaticWithConfig(middleware.StaticConfig{
|
|
||||||
Filesystem: getFileSystem("dist"),
|
Filesystem: getFileSystem("dist"),
|
||||||
HTML5: true, // Enable fallback to index.html
|
HTML5: true, // Enable fallback to index.html
|
||||||
Skipper: apiSkipper,
|
Skipper: apiSkipper,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue