Commit 6818a06 1 parent 67e2c2a commit 6818a06 Copy full SHA for 6818a06
File tree 2 files changed +32
-3
lines changed
2 files changed +32
-3
lines changed Original file line number Diff line number Diff line change 25
25
passwords = data_bag_item ( "matomo" , "passwords" )
26
26
27
27
package %w[
28
+ brotli
29
+ gzip
28
30
php-cli
29
31
php-curl
30
32
php-mbstring
153
155
subscribes :run , "execute[core:update]"
154
156
end
155
157
158
+ execute "/opt/matomo-#{ version } /matomo/matomo.br" do
159
+ action :nothing
160
+ command "brotli -k -9 /opt/matomo-#{ version } /matomo/matomo.js"
161
+ cwd "/opt/matomo-#{ version } "
162
+ user "root"
163
+ group "root"
164
+ subscribes :run , "execute[custom-matomo-js:update]"
165
+ end
166
+
156
167
execute "/opt/matomo-#{ version } /matomo/matomo.js" do
157
168
action :nothing
158
169
command "gzip -k -9 /opt/matomo-#{ version } /matomo/matomo.js"
162
173
subscribes :run , "execute[custom-matomo-js:update]"
163
174
end
164
175
176
+ execute "/opt/matomo-#{ version } /matomo/piwik.br" do
177
+ action :nothing
178
+ command "brotli -k -9 /opt/matomo-#{ version } /matomo/piwik.js"
179
+ cwd "/opt/matomo-#{ version } "
180
+ user "root"
181
+ group "root"
182
+ subscribes :run , "execute[custom-matomo-js:update]"
183
+ end
184
+
165
185
execute "/opt/matomo-#{ version } /matomo/piwik.js" do
166
186
action :nothing
167
187
command "gzip -k -9 /opt/matomo-#{ version } /matomo/piwik.js"
Original file line number Diff line number Diff line change 57
57
ExpiresActive On
58
58
RewriteEngine on
59
59
60
- RewriteCond "%{HTTP:Accept-encoding}" "gzip"
60
+ RewriteCond "%{HTTP:Accept-Encoding}" "br"
61
+ RewriteCond "%{REQUEST_FILENAME}\.br" -s
62
+ RewriteRule "^(.*)\.js" "$1\.js\.br" [QSA]
63
+
64
+ RewriteCond "%{HTTP:Accept-Encoding}" "gzip"
61
65
RewriteCond "%{REQUEST_FILENAME}\.gz" -s
62
66
RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA]
63
67
64
- RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]
68
+ RewriteRule "\.js\.(br|gz)$" "-" [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
69
+
70
+ < FilesMatch "\.js\.br$">
71
+ Header append Content-Encoding br
72
+ Header append Vary Accept-Encoding
73
+ </ FilesMatch >
65
74
66
75
< FilesMatch "\.js\.gz$">
67
76
Header append Content-Encoding gzip
68
77
Header append Vary Accept-Encoding
69
78
</ FilesMatch >
70
79
71
- < FilesMatch "(\.js|\.js\.gz)$">
80
+ < FilesMatch "(\.js|\.js\.gz|\.js\.br )$">
72
81
ExpiresDefault "access plus 1 week"
73
82
Header set Cache-Control "max-age=604800"
74
83
</ FilesMatch >
You can’t perform that action at this time.
0 commit comments