From c35ebbd949b11cfd07e4257020d22631ddc10492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Tue, 4 Feb 2020 12:37:43 +0100 Subject: [PATCH] copr: do not cache logs and repodata in CloudFront --- roles/copr/backend/files/lighttpd/lighttpd.conf | 5 +++++ roles/copr/backend/files/lighttpd/lighttpd_dev.conf | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/roles/copr/backend/files/lighttpd/lighttpd.conf b/roles/copr/backend/files/lighttpd/lighttpd.conf index 897e7c5b2b..c599e2983e 100644 --- a/roles/copr/backend/files/lighttpd/lighttpd.conf +++ b/roles/copr/backend/files/lighttpd/lighttpd.conf @@ -499,5 +499,10 @@ $HTTP["url"] !~ "^/archive/spacewalk($|/)" { # https://pagure.io/copr/copr/issue/762 $HTTP["url"] =~ "\.log$" { + setenv.add-response-header = ( "Cache-Control" => "no-store") mimetype.assign = ("" => "text/plain; charset=utf-8" ) } + +$HTTP["url"] =~ "/repodata/*" { + setenv.add-response-header = ( "Cache-Control" => "no-cache") +} diff --git a/roles/copr/backend/files/lighttpd/lighttpd_dev.conf b/roles/copr/backend/files/lighttpd/lighttpd_dev.conf index 6e33d40ae7..9f26628c2a 100644 --- a/roles/copr/backend/files/lighttpd/lighttpd_dev.conf +++ b/roles/copr/backend/files/lighttpd/lighttpd_dev.conf @@ -506,9 +506,14 @@ $HTTP["url"] =~ "\.log\.gz$" { # https://pagure.io/copr/copr/issue/762 $HTTP["url"] =~ "\.log$" { + setenv.add-response-header = ( "Cache-Control" => "no-store") mimetype.assign = ("" => "text/plain; charset=utf-8" ) } +$HTTP["url"] =~ "/repodata/*" { + setenv.add-response-header = ( "Cache-Control" => "no-cache") +} + url.redirect = ( "^/results/(.*)/(.*)/mageia-(.*)-i386(.*)" => "/results/$1/$2/mageia-$3-i586$4", "^/(.*)/redirect-live.log$" => "/$1/builder-live.log.gz"