roles/nginx: Adjust Cache-Control headers

Use "public" with "max-age" instead of Expires, as "max-age" is always
preferred if it's present.  Note: setting "public" doesn't make the
resource "more cacheable", but it is just more explicit.

Signed-off-by: Alan Orth <>
Alan Orth 9 years ago
parent b71269e6cb
commit c870044584
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

@ -20,7 +20,7 @@ Once you've satisfied the the above assumptions, you can execute:
ansible-playbook web.yml -i hosts -K
### Testing in a VM
### Testing in a VM (KVM)
A simple way to test locally in a virtual machine using libvirt + KVM:
@ -28,3 +28,25 @@ sudo virt-install -n web01 -r 1024 --vcpus 2 -l
This boots from a network Ubuntu mirror, then uses a preseed to automate the OS installation.
### Testing in Vagrant
Not as simple as on GNU/Linux with KVM, but still easy:
vagrant init ubuntu/trusty64
Then uncomment the following line in your `Vagrantfile`:
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network. "public_network"
And finally, bring the machine up:
vagrant up

@ -6,8 +6,7 @@
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires 7d;
add_header Cache-Control "must-revalidate";
add_header Cache-Control "public, max-age=604800";
# Add trailing slash to */wp-admin requests.