File tree 7 files changed +48
-15
lines changed
7 files changed +48
-15
lines changed Original file line number Diff line number Diff line change 20
20
run : ./bin/build.sh test/conf/.htaccess test/build/htaccess_fixture.conf
21
21
22
22
- name : Test with server-configs-test
23
- uses : h5bp/server-configs-test@5.1 .0
23
+ uses : h5bp/server-configs-test@5.2 .0
24
24
with :
25
25
command : test
26
26
server : httpd
29
29
tests : basic-file-access:cache-busting:custom-errors:forbidden-files:enforce-gzip:precompressed-files-gzip:concatenation
30
30
31
31
- name : Benchmark
32
- uses : h5bp/server-configs-test@5.1 .0
32
+ uses : h5bp/server-configs-test@5.2 .0
33
33
with :
34
34
command : benchmark
35
35
server : httpd
Original file line number Diff line number Diff line change @@ -31,18 +31,17 @@ jobs:
31
31
"httpd.conf"
32
32
33
33
- name : Test with server-configs-test
34
- uses : h5bp/server-configs-test@5.1 .0
34
+ uses : h5bp/server-configs-test@5.2 .0
35
35
with :
36
36
command : test
37
37
server : httpd
38
38
root-path : /usr/local/apache2/htdocs
39
39
certs-path : /usr/local/apache2/certs
40
40
configs-volumes : test/vhosts:/usr/local/apache2/vhosts;h5bp:/usr/local/apache2/h5bp;httpd.conf:/usr/local/apache2/conf/httpd.conf
41
- # tests: basic-file-access;caching;cache-busting;custom-errors;forbidden-files;enforce-gzip;precompressed-files-gzip;rewrites;ssl
42
- tests : basic-file-access;cache-busting;custom-errors;forbidden-files;enforce-gzip;precompressed-files-gzip;rewrites;ssl
41
+ tests : basic-file-access;caching;cache-busting;custom-errors;forbidden-files;enforce-gzip;precompressed-files-gzip;rewrites;ssl
43
42
44
43
- name : Benchmark
45
- uses : h5bp/server-configs-test@5.1 .0
44
+ uses : h5bp/server-configs-test@5.2 .0
46
45
with :
47
46
command : benchmark
48
47
server : httpd
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ enable "h5bp/web_performance/compression.conf"
82
82
disable "h5bp/web_performance/pre-compressed_content_brotli.conf"
83
83
disable "h5bp/web_performance/pre-compressed_content_gzip.conf"
84
84
disable "h5bp/web_performance/content_transformation.conf"
85
- enable "h5bp/web_performance/etags .conf"
85
+ enable "h5bp/web_performance/no_etags .conf"
86
86
enable "h5bp/web_performance/cache_expiration.conf"
87
87
disable "h5bp/web_performance/file_concatenation.conf"
88
88
disable "h5bp/web_performance/filename-based_cache_busting.conf"
Original file line number Diff line number Diff line change 2
2
# | ETags |
3
3
# ----------------------------------------------------------------------
4
4
5
- # Remove `ETags` as resources are sent with far-future expires headers.
5
+ # Enable ETags.
6
+ #
7
+ # (1) Don't change the ETag on a compressed response.
8
+ # Default prevents serving "HTTP Not Modified" (304) responses to
9
+ # conditional requests for compressed content.
10
+ # https://httpd.apache.org/docs/current/mod/mod_deflate.html#deflatealteretag
11
+ #
12
+ # (2) `DeflateAlterETag` is not supported on version older than 2.5.
13
+ # As an alternative of the previous directive, this one is used to keep
14
+ # both the original ETag and the modified one when compressing responses.
15
+ # https://symfony.com/doc/current/http_cache/validation.html
6
16
#
7
17
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag
8
- # https://developer.yahoo .com/performance/rules.html#etags
18
+ # https://developers.google .com/web/fundamentals/ performance/optimizing-content-efficiency/http-caching
9
19
# https://tools.ietf.org/html/rfc7232#section-2.3
20
+ # https://httpd.apache.org/docs/current/mod/core.html#fileetag
21
+
22
+ FileETag MTime Size
10
23
11
- # `FileETag None` doesn't work in all cases.
12
- <IfModule mod_headers.c>
13
- Header unset ETag
14
- </IfModule>
24
+ # (1)
25
+ #DeflateAlterETag NoChange
15
26
16
- FileETag None
27
+ # (2)
28
+ RequestHeader edit "If-None-Match" '^"((.*)-gzip)"$' '"$1", "$2"'
Original file line number Diff line number Diff line change
1
+ # ----------------------------------------------------------------------
2
+ # | ETags |
3
+ # ----------------------------------------------------------------------
4
+
5
+ # Remove `ETags` as resources are sent with far-future expires headers.
6
+ #
7
+ # Apache `ETags` might have an unexpected behavior if `DeflateAlterETag`
8
+ # can't be changed (which is the case at `.htaccess` level).
9
+ #
10
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag
11
+ # https://developer.yahoo.com/performance/rules.html#etags
12
+ # https://tools.ietf.org/html/rfc7232#section-2.3
13
+
14
+ # `FileETag None` doesn't work in all cases.
15
+ <IfModule mod_headers.c>
16
+ Header unset ETag
17
+ </IfModule>
18
+
19
+ FileETag None
Original file line number Diff line number Diff line change @@ -154,6 +154,9 @@ EnableSendfile On
154
154
# Enable gzip compression.
155
155
Include h5bp/web_performance/compression.conf
156
156
157
+ # Enable ETags validation.
158
+ Include h5bp/web_performance/cache_expiration.conf
159
+
157
160
# Specify file cache expiration.
158
161
Include h5bp/web_performance/cache_expiration.conf
159
162
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ enable "h5bp/web_performance/compression.conf"
80
80
enable "h5bp/web_performance/pre-compressed_content_brotli.conf"
81
81
enable "h5bp/web_performance/pre-compressed_content_gzip.conf"
82
82
omit "h5bp/web_performance/content_transformation.conf"
83
- enable "h5bp/web_performance/etags .conf"
83
+ enable "h5bp/web_performance/no_etags .conf"
84
84
enable "h5bp/web_performance/cache_expiration.conf"
85
85
enable "h5bp/web_performance/file_concatenation.conf"
86
86
enable "h5bp/web_performance/filename-based_cache_busting.conf"
You can’t perform that action at this time.
0 commit comments