diff options
author | tdro <tdro@noreply.example.com> | 2022-05-28 17:53:31 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-05-28 17:53:31 -0400 |
commit | 0286144b14ef7ce2a943999fc616c3c24be83c57 (patch) | |
tree | b4bab8c5d46f8a02c756b0fd202b4c084f2bda0d /content/canory/messages/cache.md | |
parent | 854481ff9080a8af8ac3adfdbb00da10e5656689 (diff) | |
download | canory-0286144b14ef7ce2a943999fc616c3c24be83c57.tar.gz canory-0286144b14ef7ce2a943999fc616c3c24be83c57.tar.bz2 canory-0286144b14ef7ce2a943999fc616c3c24be83c57.zip |
config: Set caches
Diffstat (limited to 'content/canory/messages/cache.md')
-rw-r--r-- | content/canory/messages/cache.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/content/canory/messages/cache.md b/content/canory/messages/cache.md new file mode 100644 index 0000000..cb408be --- /dev/null +++ b/content/canory/messages/cache.md @@ -0,0 +1,35 @@ ++++ +date = "2022-02-27T20:18:43+00:00" +lastmod = "2022-02-27T20:18:43+00:00" +tags = [ "docs", "cache" ] +author = "canory" ++++ + +Resource abuse is not good --- cache responsibly. In the `hugo` configuration +file (config.yaml, config.json, config.toml) set the cache expiry time. The +default is `12h` (12 hours) for remote fetches and `-1` (forever) for assets, +images, and modules. The time scales are seconds (`s`), minutes (`m`), and hours +(`h`). Turn off a cache by setting a max age of `0`. + +```yaml {options="hl_lines=9-17",caption="Caching Options"} +--- +caches: + assets: + dir: :resourceDir/_gen + maxAge: -1 + images: + dir: :resourceDir/_gen + maxAge: -1 + getcsv: + dir: :resourceDir/caches + maxAge: 12h + getjson: + dir: :resourceDir/caches + maxAge: 12h + getresource: + dir: :resourceDir/caches + maxAge: 12h + modules: + dir: :resourceDir/caches + maxAge: -1 +``` |