Variable naming cleanup.

This commit is contained in:
mikestefanello 2021-12-11 19:32:34 -05:00
parent bbf27d1b04
commit 5582bb6acd
5 changed files with 51 additions and 46 deletions

View file

@ -78,16 +78,17 @@ func (t *Controller) cachePage(c echo.Context, p Page, html *bytes.Buffer) {
return
}
if p.Cache.MaxAge == 0 {
p.Cache.MaxAge = t.Container.Config.Cache.Expiration.Page
if p.Cache.Expiration == 0 {
p.Cache.Expiration = t.Container.Config.Cache.Expiration.Page
}
key := c.Request().URL.String()
opts := &store.Options{
Expiration: p.Cache.MaxAge,
Expiration: p.Cache.Expiration,
Tags: p.Cache.Tags,
}
cp := middleware.CachedPage{
URL: key,
HTML: html.Bytes(),
Headers: p.Headers,
StatusCode: p.StatusCode,

View file

@ -37,9 +37,9 @@ type Page struct {
CSRF string
Headers map[string]string
Cache struct {
Enabled bool
MaxAge time.Duration
Tags []string
Enabled bool
Expiration time.Duration
Tags []string
}
RequestID string
}

View file

@ -26,6 +26,7 @@ func (r *Register) Get(c echo.Context) error {
p.Name = "register"
p.Title = "Register"
p.Data = r.form
return r.RenderPage(c, p)
}