hugo/hugolib
Bjørn Erik Pedersen f7aeaa6129 Add a consolidated file cache
This commits reworks how file caching is performed in Hugo. Now there is only one way, and it can be configured.

This is the default configuration:

```toml
[caches]
[caches.getjson]
dir = ":cacheDir"
maxAge = -1
[caches.getcsv]
dir = ":cacheDir"
maxAge = -1
[caches.images]
dir = ":resourceDir/_gen"
maxAge = -1
[caches.assets]
dir = ":resourceDir/_gen"
maxAge = -1
```

You can override any of these cache setting in your own `config.toml`.

The placeholders explained:

`:cacheDir`: This is the value of the `cacheDir` config option if set (can also be set via OS env variable `HUGO_CACHEDIR`). It will fall back to `/opt/build/cache/hugo_cache/` on Netlify, or a `hugo_cache` directory below the OS temp dir for the others.
`:resourceDir`: This is the value of the `resourceDir` config option.

`maxAge` is the time in seconds before a cache entry will be evicted, -1 means forever and 0 effectively turns that particular cache off.

This means that if you run your builds on Netlify, all caches configured with `:cacheDir` will be saved and restored on the next build. For other CI vendors, please read their documentation. For an CircleCI example, see 6c3960a8f4/.circleci/config.yml

Fixes #5404
2018-11-13 14:19:42 +01:00
..
filesystems Add a consolidated file cache 2018-11-13 14:19:42 +01:00
pagemeta Run gofmt -s 2018-10-24 00:12:32 +02:00
paths commands: Show server error info in browser 2018-10-16 22:10:56 +02:00
testdata
testsite
404_test.go
alias.go Make WARN the new default log log level 2018-11-03 12:06:23 +01:00
alias_test.go
author.go
case_insensitive_test.go
collections.go
collections_test.go
config.go hugolib: Remove deprecated useModTimeAsFallback 2018-11-01 21:14:30 +01:00
config_test.go
datafiles_test.go commands: Show server error info in browser 2018-10-16 22:10:56 +02:00
disableKinds_test.go
embedded_shortcodes_test.go Re-organize the figure shortcode for better readability 2018-10-03 09:55:53 +03:00
embedded_templates_test.go
fileInfo.go commands: Show server error info in browser 2018-10-16 22:10:56 +02:00
gitinfo.go
hugo_info.go
hugo_info_test.go
hugo_sites.go hugolib: Fix changing paginators in lazy render 2018-11-06 11:04:10 +01:00
hugo_sites_build.go hugolib: Continue the file context/line number errors work 2018-10-22 20:46:14 +02:00
hugo_sites_build_errors_test.go Add file (line/col) info to ref/relref errors 2018-11-01 21:06:35 +01:00
hugo_sites_build_test.go Resolve error handling/parser related TODOs 2018-10-23 19:41:22 +02:00
hugo_sites_multihost_test.go
hugo_themes_test.go
language_content_dir_test.go
media.go
menu.go
menu_test.go
minify_publisher_test.go
multilingual.go
orderedMap.go
orderedMap_test.go
page.go hugolib: Fix changing paginators in lazy render 2018-11-06 11:04:10 +01:00
page_content.go Make WARN the new default log log level 2018-11-03 12:06:23 +01:00
page_errors.go hugolib: Continue the file context/line number errors work 2018-10-22 20:46:14 +02:00
page_output.go
page_paths.go hugolib: Remove the now superflous Source struct 2018-10-22 20:46:14 +02:00
page_paths_test.go
page_permalink_test.go
page_ref.go Add file (line/col) info to ref/relref errors 2018-11-01 21:06:35 +01:00
page_resource.go
page_taxonomy_test.go
page_test.go Fix shortcode directly following a shortcode delimiter 2018-11-05 14:14:28 +01:00
page_time_integration_test.go hugolib: Integrate new page parser 2018-10-22 20:46:13 +02:00
page_without_content.go
pagebundler.go hugolib: Rename some page_* files 2018-10-23 22:21:21 +02:00
pagebundler_capture.go Make WARN the new default log log level 2018-11-03 12:06:23 +01:00
pagebundler_capture_test.go hugolib: Rename some page_* files 2018-10-23 22:21:21 +02:00
pagebundler_handlers.go hugolib: Rename some page_* files 2018-10-23 22:21:21 +02:00
pagebundler_test.go hugolib: Rename some page_* files 2018-10-23 22:21:21 +02:00
pageCache.go
pageCache_test.go
pagecollections.go hugolib: Rename some page_* files 2018-10-23 22:21:21 +02:00
pagecollections_test.go hugolib: Rename some page_* files 2018-10-23 22:21:21 +02:00
pageGroup.go
pageGroup_test.go
pages_language_merge.go
pages_language_merge_test.go
pages_related.go
pages_related_test.go
pageSort.go hugolib: Bump to ERROR for the deprecated Pages.Sort 2018-11-01 21:11:45 +01:00
pageSort_test.go
pagesPrevNext.go
pagesPrevNext_test.go
pagination.go
pagination_test.go
path_separators_test.go hugolib: Integrate new page parser 2018-10-22 20:46:13 +02:00
permalinker.go
permalinks.go helpers: Consolidate MakeSegment vs MakePathSanitized 2018-10-03 15:55:25 +02:00
permalinks_test.go hugolib: Integrate new page parser 2018-10-22 20:46:13 +02:00
prune_resources.go Add a consolidated file cache 2018-11-13 14:19:42 +01:00
resource_chain_test.go resource: Allow .Data.Integrity to be accessed on its own 2018-10-27 11:34:15 +02:00
robotstxt_test.go
rss_test.go hugolib: Remove deprecated rssURI 2018-09-21 14:30:57 +02:00
shortcode.go Add file (line/col) info to ref/relref errors 2018-11-01 21:06:35 +01:00
shortcode_test.go Add file (line/col) info to ref/relref errors 2018-11-01 21:06:35 +01:00
site.go hugolib: Improve error message on duplicate menu items 2018-11-07 10:38:58 +01:00
site_benchmark_test.go
site_output.go Run gofmt -s 2018-10-24 00:12:32 +02:00
site_output_test.go
site_render.go Resolve error handling/parser related TODOs 2018-10-23 19:41:22 +02:00
site_sections.go hugolib: Allow nil to be unwrapped as *Page 2018-10-03 09:33:42 +03:00
site_sections_test.go hugolib: Allow nil to be unwrapped as *Page 2018-10-03 09:33:42 +03:00
site_stats_test.go
site_test.go Resolve error handling/parser related TODOs 2018-10-23 19:41:22 +02:00
site_url_test.go
siteJSONEncode_test.go
sitemap.go
sitemap_test.go
taxonomy.go
taxonomy_test.go hugolib: Normalize permalink path segments 2018-10-03 11:02:15 +03:00
template_engines_test.go
template_test.go tpl: Fix BOM issue in templates 2018-10-30 18:12:14 +01:00
testhelpers_test.go hugolib: Fix broken manual summary handling 2018-10-31 23:14:37 +01:00
translations.go