From f2fc4db1ea0dbf4a1f75fb3e52b64e6f529e5e44 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Tue, 6 Dec 2016 17:53:57 -0800 Subject: adding cache (client-based, Etag) to API responses in addition to static files uploaded --- system/api/server.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'system/api') diff --git a/system/api/server.go b/system/api/server.go index 823ec16..41d652a 100644 --- a/system/api/server.go +++ b/system/api/server.go @@ -2,15 +2,17 @@ package api import ( "net/http" + + "github.com/bosssauce/ponzu/system/db" ) // Run adds Handlers to default http listener for API func Run() { - http.HandleFunc("/api/types", CORS(Record(typesHandler))) + http.HandleFunc("/api/types", db.CacheControl(CORS(Record(typesHandler)))) - http.HandleFunc("/api/contents", CORS(Record(contentsHandler))) + http.HandleFunc("/api/contents", db.CacheControl(CORS(Record(contentsHandler)))) - http.HandleFunc("/api/content", CORS(Record(contentHandler))) + http.HandleFunc("/api/content", db.CacheControl(CORS(Record(contentHandler)))) - http.HandleFunc("/api/content/external", CORS(Record(externalContentHandler))) + http.HandleFunc("/api/content/external", db.CacheControl(CORS(Record(externalContentHandler)))) } -- cgit v1.2.3