mirror of
https://github.com/jgeusebroek/docker-spotweb.git
synced 2025-06-06 07:37:25 +02:00
Merge pull request #18 from jamesstout/caching-and-compression
Caching and compression conf
This commit is contained in:
commit
5931aae0fa
@ -29,6 +29,11 @@ RUN chmod u+x /entrypoint.sh
|
|||||||
|
|
||||||
COPY files/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
COPY files/000-default.conf /etc/apache2/sites-enabled/000-default.conf
|
||||||
|
|
||||||
|
# Add caching and compression config to .htaccess
|
||||||
|
COPY files/001-htaccess.conf .
|
||||||
|
RUN cat /001-htaccess.conf >> /var/www/spotweb/.htaccess
|
||||||
|
RUN rm /001-htaccess.conf
|
||||||
|
|
||||||
VOLUME [ "/config" ]
|
VOLUME [ "/config" ]
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
@ -54,7 +54,15 @@ fi
|
|||||||
# Clean up apache pid (if there is one)
|
# Clean up apache pid (if there is one)
|
||||||
rm -rf /run/apache2/apache2.pid
|
rm -rf /run/apache2/apache2.pid
|
||||||
|
|
||||||
# Enabling PHP mod rewrite
|
# Enabling PHP mod rewrite, expires and deflate (they may be on already by default)
|
||||||
/usr/sbin/a2enmod rewrite && /etc/init.d/apache2 restart
|
unset rt
|
||||||
|
/usr/sbin/a2enmod rewrite && rt=1
|
||||||
|
/usr/sbin/a2enmod expires && rt=1
|
||||||
|
/usr/sbin/a2enmod deflate && rt=1
|
||||||
|
|
||||||
|
# Only restart if one of the enmod commands succeeded
|
||||||
|
if [[ -n $rt ]]; then
|
||||||
|
/etc/init.d/apache2 restart
|
||||||
|
fi
|
||||||
|
|
||||||
tail -F /var/log/apache2/* /dev/stdout /dev/stderr
|
tail -F /var/log/apache2/* /dev/stdout /dev/stderr
|
||||||
|
32
files/001-htaccess.conf
Normal file
32
files/001-htaccess.conf
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<IfModule mod_expires.c>
|
||||||
|
ExpiresActive On
|
||||||
|
ExpiresDefault "access plus 4 hours"
|
||||||
|
ExpiresByType application/javascript A900
|
||||||
|
ExpiresByType application/x-javascript A900
|
||||||
|
ExpiresByType text/javascript A900
|
||||||
|
ExpiresByType text/html A90
|
||||||
|
ExpiresByType text/xml A90
|
||||||
|
ExpiresByType text/css A900
|
||||||
|
ExpiresByType text/plain A62
|
||||||
|
ExpiresByType image/gif A14400
|
||||||
|
ExpiresByType image/jpg A14400
|
||||||
|
ExpiresByType image/jpeg A14400
|
||||||
|
ExpiresByType image/png A14400
|
||||||
|
ExpiresByType image/bmp A14400
|
||||||
|
ExpiresByType application/x-shockwave-flash A3600
|
||||||
|
</IfModule>
|
||||||
|
<IfModule mod_deflate.c>
|
||||||
|
AddOutputFilterByType DEFLATE text/plain
|
||||||
|
AddOutputFilterByType DEFLATE text/html
|
||||||
|
AddOutputFilterByType DEFLATE text/xml
|
||||||
|
AddOutputFilterByType DEFLATE text/css
|
||||||
|
AddOutputFilterByType DEFLATE application/xml
|
||||||
|
AddOutputFilterByType DEFLATE application/xhtml+xml
|
||||||
|
AddOutputFilterByType DEFLATE application/rss+xml
|
||||||
|
AddOutputFilterByType DEFLATE application/javascript
|
||||||
|
AddOutputFilterByType DEFLATE application/x-javascript
|
||||||
|
|
||||||
|
BrowserMatch ^Mozilla/4 gzip-only-text/html
|
||||||
|
BrowserMatch ^Mozilla/4\.0[678] no-gzip
|
||||||
|
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
|
||||||
|
</IfModule>
|
Loading…
x
Reference in New Issue
Block a user