From 9b8d43420000432a84522f071e3572a8887041f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 18 Jan 2022 06:50:32 +0100 Subject: blog module set up caching. --- manifests/instance.pp | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'manifests') diff --git a/manifests/instance.pp b/manifests/instance.pp index 07db874..8f9f1d1 100644 --- a/manifests/instance.pp +++ b/manifests/instance.pp @@ -71,13 +71,27 @@ define blog::instance ( } nginx::resource::location { "${safe_title} - /": - location => '/', - try_files => ['$uri', '$uri/', '=404'], - index_files => [], - ssl => true, - ssl_only => true, - autoindex => on, - server => $blog::blog_server_name, + location => '/', + try_files => ['$uri', '$uri/', '=404'], + index_files => [], + ssl => true, + ssl_only => true, + autoindex => on, + server => $blog::blog_server_name, + add_header => { + 'Cache-Control' => "no-cache", + }, + } + + nginx::resource::location { "${safe_title} - css": + location => '~ \.css$', + try_files => [ '$uri', '=404' ], + ssl => true, + ssl_only => true, + expires => '1h', + add_header => { + 'Cache-Control' => "no-cache", + }, } nginx::resource::location { "${safe_title} - php": -- cgit v1.2.3