cache fix
This commit is contained in:
parent
5089dea7a1
commit
d37bbd85a5
1 changed files with 5 additions and 2 deletions
|
|
@ -76,8 +76,11 @@ func ChatRoom(ctx *h.RequestContext) *h.Page {
|
|||
)
|
||||
}
|
||||
|
||||
var CachedRoomHeader = h.CachedT(time.Hour, func(ctx *h.RequestContext) *h.Element {
|
||||
return roomNameHeader(ctx)
|
||||
var CachedRoomHeader = h.CachedPerKeyT(time.Hour, func(ctx *h.RequestContext) (string, h.GetElementFunc) {
|
||||
roomId := chi.URLParam(ctx.Request, "id")
|
||||
return roomId, func() *h.Element {
|
||||
return roomNameHeader(ctx)
|
||||
}
|
||||
})
|
||||
|
||||
func roomNameHeader(ctx *h.RequestContext) *h.Element {
|
||||
|
|
|
|||
Loading…
Reference in a new issue