Hi all,

 I've wrote two patch for issue #7629.

pagure frontend: caching emojione sprites for 1 week

 roles/pagure/frontend/templates/0_pagure.conf | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/roles/pagure/frontend/templates/0_pagure.conf
b/roles/pagure/frontend/templates/0_pagure.conf
index 50c2d6e9b..87009fce0 100644
--- a/roles/pagure/frontend/templates/0_pagure.conf
+++ b/roles/pagure/frontend/templates/0_pagure.conf
@@ -78,6 +78,12 @@ WSGIDaemonProcess paguredocs user=git group=git
maximum-requests=1000 display-na

   Alias /static /usr/lib/python2.7/site-packages/pagure/static/

+ <Location "/static/vendor/emojione/emojione.sprites.png">
+ ExpiresActive On
+ ExpiresDefault "access plus 1 week"
+ Header append Cache-Control "public"
+ </Location>
+
   SetEnv GIT_PROJECT_ROOT /srv/git/repositories

   <Location />
@@ -145,6 +151,12 @@ WSGIDaemonProcess paguredocs user=git group=git
maximum-requests=1000 display-na

   Alias /static /usr/lib/python2.7/site-packages/pagure/static/

+ <Location "/static/vendor/emojione/emojione.sprites.png">
+ ExpiresActive On
+ ExpiresDefault "access plus 1 week"
+ Header append Cache-Control "public"
+ </Location>
+
   <Location />
     WSGIProcessGroup paguredocs
     <IfModule mod_authz_core.c>
-- 
2.20.1


Site src.fp.org:  caching emojione sprites for 1 week


---
 roles/fedora-web/src/files/expires.conf    |  5 +++++
 roles/fedora-web/src/tasks/main.yml        | 12 ++++++++++++
 roles/httpd/website/templates/website.conf |  5 ++++-
 4 files changed, 22 insertions(+), 2 deletions(-)
 create mode 100644 roles/fedora-web/src/files/expires.conf

diff --git a/roles/fedora-web/src/files/expires.conf
b/roles/fedora-web/src/files/expires.conf
new file mode 100644
index 000000000..199080880
--- /dev/null
+++ b/roles/fedora-web/src/files/expires.conf
@@ -0,0 +1,5 @@
+<Location "/static/vendor/emojione/emojione.sprites.png">
+ ExpiresActive On
+ ExpiresDefault "access plus 1 week"
+ Header append Cache-Control "public"
+</Location>
diff --git a/roles/fedora-web/src/tasks/main.yml
b/roles/fedora-web/src/tasks/main.yml
index d7616e84c..fbe8e87d1 100644
--- a/roles/fedora-web/src/tasks/main.yml
+++ b/roles/fedora-web/src/tasks/main.yml
@@ -19,3 +19,15 @@
   tags:
   - fedora-web
   - fedora-web/src
+
+- name: Copy some config files for {{website}}
+ copy: >
+ src={{item}} dest=/etc/httpd/conf.d/{{website}}/{{item}}
+ owner=root group=root mode=0644
+ with_items:
+ - expires.conf
+ notify:
+ - reload proxyhttpd
+ tags:
+ - fedora-web
+ - fedora-web/src
diff --git a/roles/httpd/website/templates/website.conf
b/roles/httpd/website/templates/website.conf
index 2a6241a77..931655e6a 100644
--- a/roles/httpd/website/templates/website.conf
+++ b/roles/httpd/website/templates/website.conf
@@ -20,6 +20,10 @@
   Alias /static/hotspot.txt /srv/web/hotspot.txt
 {% endif %}

+{% if site_name == "src.fedoraproject.org" %}
+ Include "conf.d/src.fedoraproject.org/expires.conf"
+{% endif %}
+
 {% if sslonly %}
   RewriteEngine On
   RewriteCond %{REQUEST_URI} !/.well-known/acme-challenge/.*
@@ -85,4 +89,3 @@
   Include "conf.d/{{ site_name }}/*.conf"
 </VirtualHost>
 {% endif %}
-
-- 
2.20.1



-- 
Alessandro Lorenzi

_______________________________________________
infrastructure mailing list -- infrastructure@lists.fedoraproject.org
To unsubscribe send an email to infrastructure-le...@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/infrastructure@lists.fedoraproject.org

Reply via email to