Cookbooks
haproxy
documentation
Haproxy Cache

Back To Resource List (opens in a new tab)


haproxy_cache

Cache describes a shared cache for small objects such as CSS, JS and icon files. Useful for web application acceleration. Available in HAProxy version 1.8 and later, and max_object_size in 1.9 and later.

Introduced: v6.3.0

Actions

  • :create
  • :delete

Properties

This resource also uses the following partial resources:

NameTypeDefaultDescriptionAllowed Values
cache_nameStringname_propertyName of the cache
total_max_sizeIntegerNoneDefine the size in RAM of the cache in megabytes
max_object_sizeIntegerNoneDefine the maximum size of the objects to be cached
max_ageIntegerNoneDefine the maximum expiration duration in seconds

Examples

haproxy_cache 'test' do
  total_max_size 4
  max_age 60
  max_object_size 1000000
end