mirror of
https://github.com/getAlby/lndhub.go.git
synced 2025-12-21 06:34:58 +01:00
Set cache-control headers for static routes (getinfor and home)
This tells clients to cache the response for a few minutes and thus makes it easier to run lndhub behind a proxy to cache static response
This commit is contained in:
@@ -117,6 +117,7 @@ func (controller *HomeController) Home(c echo.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Response().Header().Set(echo.HeaderCacheControl, "public, max-age=300, stale-if-error=21600") // cache for 5 minutes or if error for 6 hours max
|
||||
return c.HTMLBlob(http.StatusOK, buf.Bytes())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user