Puppet Class: apache::mod::cache

Defined in:
manifests/mod/cache.pp

Summary

Installs `mod_cache`

Overview

Parameters:

  • cache_ignore_headers (Array[String[1]]) (defaults to: [])

    Specifies HTTP header(s) that should not be stored in the cache.

  • cache_default_expire (Optional[Integer]) (defaults to: undef)

    The default duration to cache a document when no expiry date is specified.

  • cache_max_expire (Optional[Integer]) (defaults to: undef)

    The maximum time in seconds to cache a document

  • cache_ignore_no_lastmod (Optional[Apache::OnOff]) (defaults to: undef)

    Ignore the fact that a response has no Last Modified header.

  • cache_header (Optional[Apache::OnOff]) (defaults to: undef)

    Add an X-Cache header to the response.

  • cache_lock (Optional[Apache::OnOff]) (defaults to: undef)

    Enable the thundering herd lock.

  • cache_ignore_cache_control (Optional[Apache::OnOff]) (defaults to: undef)

    Ignore request to not serve cached content to client

See Also:



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'manifests/mod/cache.pp', line 27

class apache::mod::cache (
  Array[String[1]] $cache_ignore_headers              = [],
  Optional[Integer] $cache_default_expire             = undef,
  Optional[Integer] $cache_max_expire                 = undef,
  Optional[Apache::OnOff] $cache_ignore_no_lastmod    = undef,
  Optional[Apache::OnOff] $cache_header               = undef,
  Optional[Apache::OnOff] $cache_lock                 = undef,
  Optional[Apache::OnOff] $cache_ignore_cache_control = undef,
) {
  include apache
  apache::mod { 'cache': }

  $_configuration_file_name = 'cache.conf'

  file { $_configuration_file_name:
    ensure  => file,
    path    => "${apache::mod_dir}/${_configuration_file_name}",
    mode    => $apache::file_mode,
    content => epp('apache/mod/cache.conf.epp', {
        cache_ignore_headers       => $cache_ignore_headers,
        cache_default_expire       => $cache_default_expire,
        cache_max_expire           => $cache_max_expire,
        cache_ignore_no_lastmod    => $cache_ignore_no_lastmod,
        cache_header               => $cache_header,
        cache_lock                 => $cache_lock,
        cache_ignore_cache_control => $cache_ignore_cache_control,
    }),
    require => Exec["mkdir ${apache::mod_dir}"],
    before  => File[$apache::mod_dir],
    notify  => Class['apache::service'],
  }
}