summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/httpcache
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-12-23 12:45:35 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2019-12-23 12:45:35 -0700
commit95ed603de79c66ff76bfe7e42986a2fc8c7a1fa4 (patch)
tree1a788b8eba98f0c2e69e5816bac9c7cc09aca96f /modules/caddyhttp/httpcache
parentcbb405f6aaee046c9de9ffb4f07ca824d9eedeb1 (diff)
Improve godocs all around
These will be used in the new automated documentation system
Diffstat (limited to 'modules/caddyhttp/httpcache')
-rw-r--r--modules/caddyhttp/httpcache/httpcache.go30
1 files changed, 26 insertions, 4 deletions
diff --git a/modules/caddyhttp/httpcache/httpcache.go b/modules/caddyhttp/httpcache/httpcache.go
index 81f5816..f8bdde8 100644
--- a/modules/caddyhttp/httpcache/httpcache.go
+++ b/modules/caddyhttp/httpcache/httpcache.go
@@ -33,11 +33,33 @@ func init() {
}
// Cache implements a simple distributed cache.
+//
+// NOTE: This module is a work-in-progress. It is
+// not finished and is NOT ready for production use.
+// [We need your help to finish it! Please volunteer
+// in this issue.](https://github.com/caddyserver/caddy/issues/2820)
+// Until it is finished, this module is subject to
+// breaking changes.
+//
+// Caches only GET and HEAD requests. Honors the Cache-Control: no-cache header.
+//
+// Still TODO:
+//
+// - Eviction policies and API
+// - Use single cache per-process
+// - Preserve cache through config reloads
+// - More control over what gets cached
type Cache struct {
- Self string `json:"self,omitempty"`
- Peers []string `json:"peers,omitempty"`
- MaxSize int64 `json:"max_size,omitempty"`
- group *groupcache.Group
+ // The network address of this cache instance; required.
+ Self string `json:"self,omitempty"`
+
+ // A list of network addresses of cache instances in the group.
+ Peers []string `json:"peers,omitempty"`
+
+ // Maximum size of the cache, in bytes. Default is 512 MB.
+ MaxSize int64 `json:"max_size,omitempty"`
+
+ group *groupcache.Group
}
// CaddyModule returns the Caddy module information.