Set cache control headers for static assets

This commit is contained in:
Scott Peshak
2019-06-01 08:14:18 -05:00
parent 0c27a600f8
commit 37181c2d41
2 changed files with 9 additions and 3 deletions

View File

@@ -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 \

View File

@@ -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