summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/serve.fnl11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/serve.fnl b/bin/serve.fnl
index e574238..9d83b10 100644
--- a/bin/serve.fnl
+++ b/bin/serve.fnl
@@ -335,9 +335,12 @@
(category-menu-path (. form.tags 1))
nil))
(local spellfix-suggestion
- (if (and (not (str.empty? form.query)) items (< 0 (# items)))
- nil
- (spellfix.guess form.query)))
+ (if (and (not (str.empty? form.query)) items (= 0 (# items)))
+ (cache.wrap
+ db (.. "spellfix:" form.query)
+ #(spellfix.guess form.query))
+ nil))
+
[:html {:lang "ru-RU"}
[:head {}
[:meta {:charset "utf-8"}]
@@ -372,7 +375,7 @@
[:footer {} paginator]]]]]])
(fn root-handler [{: path : query}]
- (local cache-key (.. path "?" (serialize-query query)))
+ (local cache-key (.. "page:" path "?" (serialize-query query)))
(local cached (cache.get db cache-key))
(if cached
(values 200 {:content-type "text/html"} cached)