mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-26 06:37:07 +00:00
docs: describe cache.idle_ttl and the cleanup run
Document the new idle_ttl key in the example config and the README. Explain that artifacts never expire by age and that metadata entries refresh after default_ttl.
This commit is contained in:
@@ -233,7 +233,9 @@ security:
|
|||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
default_ttl: 86400 # 24 hours in seconds
|
default_ttl: 24h # Freshness window for metadata pages (version lists, package documents)
|
||||||
|
idle_ttl: 168h # Remove cached items not requested for 7 days; 0 disables
|
||||||
|
cleanup_interval: 1h
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
level: "info" # debug, info, warn, error
|
level: "info" # debug, info, warn, error
|
||||||
@@ -245,6 +247,15 @@ upstream:
|
|||||||
go: "https://proxy.golang.org"
|
go: "https://proxy.golang.org"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Cache cleanup
|
||||||
|
|
||||||
|
Every `cleanup_interval` the cleanup run removes:
|
||||||
|
|
||||||
|
- **Idle items.** Any cached item, artifact or metadata page, whose last request is older than `idle_ttl` (default `168h`, seven days). Each request, hit or miss, resets the clock. Set `idle_ttl: 0` to turn idle eviction off.
|
||||||
|
- **Stale metadata.** Version lists, package documents and Go `.mod`/`.info` files past `default_ttl`. They refresh on the next request.
|
||||||
|
|
||||||
|
Artifacts (tarballs, wheels, module zips) never expire by age, so a package that clients keep requesting stays cached. Size-based LRU eviction at `max_size_bytes` is unchanged. Removed items keep their download history in the statistics.
|
||||||
|
|
||||||
### Environment Variables
|
### Environment Variables
|
||||||
|
|
||||||
All configuration values can be overridden with environment variables:
|
All configuration values can be overridden with environment variables:
|
||||||
|
|||||||
+2
-1
@@ -89,8 +89,9 @@ metadata:
|
|||||||
log_level: "warn" # GORM log level: silent, error, warn, info
|
log_level: "warn" # GORM log level: silent, error, warn, info
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
default_ttl: "168h" # 7 days
|
default_ttl: "168h" # Freshness window for metadata pages (version lists, packuments, .mod/.info); artifacts never expire by age
|
||||||
cleanup_interval: "1h"
|
cleanup_interval: "1h"
|
||||||
|
idle_ttl: "168h" # Remove cached items not requested for this long; "0" disables
|
||||||
max_size_bytes: 536870912000 # 500GB
|
max_size_bytes: 536870912000 # 500GB
|
||||||
per_project_quota: 53687091200 # 50GB
|
per_project_quota: 53687091200 # 50GB
|
||||||
ttl_overrides:
|
ttl_overrides:
|
||||||
|
|||||||
Reference in New Issue
Block a user