Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Set cache control headers for static assets

Scott Peshak37181c2d41ad
diff --git a/extras/docker/apache/Dockerfile b/extras/docker/apache/Dockerfile
index eb558cdb3..74c8f2b1b 100644
--- a/extras/docker/apache/Dockerfile
+++ b/extras/docker/apache/Dockerfile
@@ -31,6 +31,7 @@ RUN apt-get update \
# Configure apache
ADD wger.conf /etc/apache2/sites-available/
RUN a2dissite 000-default.conf \
+ && a2enmod headers \
&& a2ensite wger \
&& echo "ServerName localhost" >> /etc/apache2/conf-available/fqdn.conf \
&& a2enconf fqdn \
diff --git a/extras/docker/apache/wger.conf b/extras/docker/apache/wger.conf
index 04409830a..d54faec1e 100644
--- a/extras/docker/apache/wger.conf
+++ b/extras/docker/apache/wger.conf
@@ -13,14 +13,19 @@
Alias /static/ /home/wger/static/
<Directory /home/wger/static>
- Require all granted
+ Require all granted
+ Header set Cache-Control "max-age=604800, public"
</Directory>
Alias /media/ /home/wger/media/
- <Directory /home/wger//media>
- Require all granted
+ <Directory /home/wger/media>
+ Require all granted
+ Header set Cache-Control "max-age=604800, public"
</Directory>
ErrorLog ${APACHE_LOG_DIR}/wger-error.log
CustomLog ${APACHE_LOG_DIR}/wger-access.log combined
</VirtualHost>
+
+ServerSignature Off
+ServerTokens Prod