Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
update: resource cache
boojack8eb4273e4a25
diff --git a/api/resource.go b/api/resource.goindex 3098e140d..a8d7a3600 100644--- a/api/resource.go+++ b/api/resource.go@@ -2,11 +2,11 @@ package apiimport ("encoding/json"- "fmt""io/ioutil""memos/api/e""memos/store""net/http"+ "strings""github.com/gorilla/mux")@@ -55,7 +55,7 @@ func handleUploadResource(w http.ResponseWriter, r *http.Request) {if err != nil {e.ErrorHandler(w, "UPLOAD_FILE_ERROR", "Read file error")- fmt.Println(err)+ return}resource, err := store.CreateResource(userId, filename, fileBytes, filetype, size)@@ -95,6 +95,17 @@ func handleGetResource(w http.ResponseWriter, r *http.Request) {resourceId := vars["id"]filename := vars["filename"]+ etag := `"` + resourceId + "/" + filename + `"`+ w.Header().Set("Etag", etag)+ w.Header().Set("Cache-Control", "max-age=2592000")++ if match := r.Header.Get("If-None-Match"); match != "" {+ if strings.Contains(match, etag) {+ w.WriteHeader(http.StatusNotModified)+ return+ }+ }+resource, err := store.GetResourceByIdAndFilename(resourceId, filename)if err != nil {