diff options
author | Steve <nilslice@gmail.com> | 2016-12-12 00:34:46 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-12 00:34:46 -0800 |
commit | e7c23d71d5179744c230ab4e25f405a5607ba905 (patch) | |
tree | 758eba1275e1436220281fd45e3ad642fcda4598 /system/db/content.go | |
parent | f39c1519ab382a343c05163f00f38c83bff3583d (diff) | |
parent | 3b10b345045428b9011eecd0ded9c04db42bf28f (diff) |
Merge pull request #20 from bosssauce/ponzu-dev
[core] cache-control & db specifier namespace clean-up
Diffstat (limited to 'system/db/content.go')
-rw-r--r-- | system/db/content.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/system/db/content.go b/system/db/content.go index 74a77ec..19c31d7 100644 --- a/system/db/content.go +++ b/system/db/content.go @@ -77,6 +77,12 @@ func update(ns, id string, data url.Values) (int, error) { go SortContent(ns) } + // update changes data, so invalidate client caching + err = InvalidateCache() + if err != nil { + return 0, err + } + return cid, nil } @@ -132,6 +138,12 @@ func insert(ns string, data url.Values) (int, error) { go SortContent(ns) } + // insert changes data, so invalidate client caching + err = InvalidateCache() + if err != nil { + return 0, err + } + return effectedID, nil } @@ -149,6 +161,12 @@ func DeleteContent(target string) error { return err } + // delete changes data, so invalidate client caching + err = InvalidateCache() + if err != nil { + return err + } + // exception to typical "run in goroutine" pattern: // we want to have an updated admin view as soon as this is deleted, so // in some cases, the delete and redirect is faster than the sort, |