浏览代码

Added caching to readme

Andrew Kane 10 年之前
父节点
当前提交
3f41d03f33
共有 1 个文件被更改,包括 24 次插入1 次删除
  1. 24 1
      README.md

+ 24 - 1
README.md

@@ -191,6 +191,16 @@ smart_columns:
   city_id: "SELECT id, name FROM cities WHERE id IN {value}"
   city_id: "SELECT id, name FROM cities WHERE id IN {value}"
 ```
 ```
 
 
+### Caching
+
+Blazer can automatically cache results to improve speed.
+
+```yml
+cache: 60 # minutes
+```
+
+Of course, you can force a refresh at any time.
+
 ## Charts
 ## Charts
 
 
 Blazer will automatically generate charts based on the types of the columns returned in your query.
 Blazer will automatically generate charts based on the types of the columns returned in your query.
@@ -341,7 +351,20 @@ data_sources:
   main:
   main:
     url: <%= ENV["BLAZER_DATABASE_URL"] %>
     url: <%= ENV["BLAZER_DATABASE_URL"] %>
 
 
-    # timeout: 15 # applies to PostgreSQL only
+    # statement timeout, in seconds
+    # applies to PostgreSQL only
+    # none by default
+    # timeout: 15
+
+    # time to cache results, in minutes
+    # can greatly improve speed
+    # none by default
+    # cache: 60
+
+    # wrap queries in a transaction for safety
+    # not necessary if you use a read-only user
+    # true by default
+    # use_transaction: false
 
 
     smart_variables:
     smart_variables:
       # zone_id: "SELECT id, name FROM zones ORDER BY name ASC"
       # zone_id: "SELECT id, name FROM zones ORDER BY name ASC"