summaryrefslogtreecommitdiff
path: root/system/db/config.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-11-29 21:43:53 -0800
committerSteve Manuel <nilslice@gmail.com>2016-11-29 21:43:53 -0800
commit49f56daeea4346f4ed8beceb4fcb07d61b03aa8d (patch)
treead5b086cb3ccc284577412afcd3a8d1d175a62ca /system/db/config.go
parenta8f83d3f8159137c8dd9d68bc69dcc773d6e7778 (diff)
adding better implementation for etag/cache invalidation
Diffstat (limited to 'system/db/config.go')
-rw-r--r--system/db/config.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/system/db/config.go b/system/db/config.go
index bfcafc6..356a2da 100644
--- a/system/db/config.go
+++ b/system/db/config.go
@@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"net/url"
+ "strings"
"time"
"github.com/bosssauce/ponzu/system/admin/config"
@@ -25,8 +26,9 @@ func SetConfig(data url.Values) error {
err := store.Update(func(tx *bolt.Tx) error {
b := tx.Bucket([]byte("_config"))
- if data.Get("cache") == "invalidate" {
+ if strings.ToLower(data.Get("cache")) == "invalidate" {
data.Set("etag", NewEtag())
+ data.Del("cache")
}
cfg := &config.Config{}