Skip to content

Conversation

Salvoxia
Copy link
Contributor

This PR allows to configure any caching setting blocky currently supports.
Up to now, the role came with a few default caching settings in the template that were not parametrized, and thus not configurable in the role.
This PR introduces the following role variables:

# Caching configuration
# Refer to https://0xerr0r.github.io/blocky/latest/configuration/#caching
blocky__caching_min_time: 5m
blocky__caching_max_time: 60m
blocky__caching_max_items_count: 0
blocky__caching_prefetching: true
blocky__caching_prefetch_expires: 2h
blocky__caching_prefetch_threshold: 5
blocky__caching_prefetch_max_items_count: 0
blocky__caching_cache_time_negative: 30m
blocky__caching_exclude: []
  # - /.*\\.lan$/
  # - /.*\\.local$/
  # - /.*\\.host\.com\.(jp|fr)$/

which creates a config block like this:

caching:
  minTime: 5m
  maxTime: 60m
  maxItemsCount: 0
  prefetching: True
  prefetchExpires: 2h
  prefetchThreshold: 5
  prefetchMaxItemsCount: 0
  cacheTimeNegative: 30m
  exclude:
    - /.*\.lan$/

All role variables that were not present in this role's previous versions are pre-set with blocky's default values for each of these parameters.
caching.exclude is only supported since v0.26, the config templates have been update accordingly. Configuring this variable with blocky versions prior to v0.26 simply will not have any effect.

Please be aware that this feature branch is based on the feature branch implementing #13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant