mirror of
https://github.com/jgeusebroek/docker-spotweb.git
synced 2025-06-03 06:07:23 +02:00
Caching and compression conf
From: https://github.com/spotweb/spotweb/wiki/Performance-tips Builds OK, caching works, compression is defaulted to 6 in zlib, didn’t notice huge spike in load. Signed-off-by: James Stout <stoutyhk@gmail.com>
This commit is contained in:
parent
c6737d23fd
commit
3081a583ed
@ -29,6 +29,11 @@ RUN chmod u+x /entrypoint.sh
|
||||
|
||||
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" ]
|
||||
|
||||
EXPOSE 80
|
||||
|
@ -54,7 +54,15 @@ fi
|
||||
# Clean up apache pid (if there is one)
|
||||
rm -rf /run/apache2/apache2.pid
|
||||
|
||||
# Enabling PHP mod rewrite
|
||||
/usr/sbin/a2enmod rewrite && /etc/init.d/apache2 restart
|
||||
# Enabling PHP mod rewrite, expires and deflate (they may be on already by default)
|
||||
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
|
||||
|
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