From 84ebdebe006a0bf783fbfd80cffbff702cbbfec2 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Wed, 30 Nov 2016 10:41:03 +0100 Subject: [PATCH] Set Cache-Control to no-cache for badges Some services might cache badges for a very long time, which may no reflect the latest changes in the governance repo. Set Cache-Control to no-cache to instruct these services to not cache badges ever. Change-Id: I535107c49d5c89b9e09b440f7aac139de213f796 --- modules/openstack_project/manifests/static.pp | 4 ++++ .../templates/static-governance.vhost.erb | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/modules/openstack_project/manifests/static.pp b/modules/openstack_project/manifests/static.pp index 1161bfa2c7..f1c9a856a4 100644 --- a/modules/openstack_project/manifests/static.pp +++ b/modules/openstack_project/manifests/static.pp @@ -56,6 +56,10 @@ class openstack_project::static ( httpd::mod { 'alias': ensure => present } } + if ! defined(Httpd::Mod['headers']) { + httpd::mod { 'headers': ensure => present } + } + if ! defined(File['/srv/static']) { file { '/srv/static': ensure => directory, diff --git a/modules/openstack_project/templates/static-governance.vhost.erb b/modules/openstack_project/templates/static-governance.vhost.erb index 93f032de0b..562991cf78 100644 --- a/modules/openstack_project/templates/static-governance.vhost.erb +++ b/modules/openstack_project/templates/static-governance.vhost.erb @@ -32,6 +32,10 @@ AllowOverride None Satisfy Any Require all granted + + Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform" + Header set Pragma "no-cache" + ErrorDocument 404 /badges/project-unofficial.svg LogLevel warn @@ -73,6 +77,10 @@ AllowOverride None Satisfy Any Require all granted + + Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform" + Header set Pragma "no-cache" + ErrorDocument 404 /badges/project-unofficial.svg LogLevel warn