Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 1 | varnishtest "Vary support" |
| 2 | |
Christopher Faulet | 85a8136 | 2020-12-15 17:13:39 +0100 | [diff] [blame] | 3 | #REQUIRE_VERSION=2.4 |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 4 | |
| 5 | feature ignore_unknown_macro |
| 6 | |
| 7 | server s1 { |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 8 | # Response varying on "accept-encoding" with |
| 9 | # an unacceptable content-encoding |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 10 | rxreq |
| 11 | expect req.url == "/accept-encoding" |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 12 | txresp -hdr "Content-Encoding: gzip" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 13 | -hdr "Vary: accept-encoding" \ |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 14 | -hdr "Cache-Control: max-age=5" \ |
| 15 | -bodylen 45 |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 16 | |
| 17 | # Response varying on "accept-encoding" |
| 18 | rxreq |
| 19 | expect req.url == "/accept-encoding" |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 20 | txresp -hdr "Content-Encoding: gzip" \ |
| 21 | -hdr "Vary: accept-encoding" \ |
| 22 | -hdr "Cache-Control: max-age=5" \ |
| 23 | -bodylen 45 |
| 24 | |
| 25 | # Response varying on "accept-encoding" with |
| 26 | # no content-encoding |
| 27 | rxreq |
| 28 | expect req.url == "/accept-encoding" |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 29 | txresp -hdr "Content-Type: text/plain" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 30 | -hdr "Vary: accept-encoding" \ |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 31 | -hdr "Cache-Control: max-age=5" \ |
| 32 | -bodylen 48 |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 33 | |
| 34 | # Response varying on "accept-encoding" but having two different encodings |
| 35 | rxreq |
| 36 | expect req.url == "/accept-encoding-multiple" |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 37 | txresp -hdr "Vary: accept-encoding" \ |
| 38 | -hdr "Cache-Control: max-age=5" \ |
| 39 | -bodylen 51 |
| 40 | |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 41 | |
| 42 | # Unmanaged vary |
| 43 | rxreq |
| 44 | expect req.url == "/unmanaged" |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 45 | txresp -hdr "Vary: accept-encoding,unmanaged" \ |
| 46 | -hdr "Cache-Control: max-age=5" \ |
| 47 | -bodylen 51 |
| 48 | |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 49 | |
| 50 | rxreq |
| 51 | expect req.url == "/unmanaged" |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 52 | txresp -hdr "Vary: accept-encoding,unmanaged" \ |
| 53 | -hdr "Cache-Control: max-age=5" \ |
| 54 | -bodylen 51 |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 55 | |
| 56 | |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 57 | |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 58 | # Mixed Vary (Accept-Encoding + Referer) |
| 59 | rxreq |
| 60 | expect req.url == "/referer-accept-encoding" |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 61 | txresp -hdr "Vary: accept-encoding,referer" \ |
| 62 | -hdr "Cache-Control: max-age=5" \ |
| 63 | -hdr "Content-Encoding: gzip" \ |
| 64 | -bodylen 51 |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 65 | |
| 66 | rxreq |
| 67 | expect req.url == "/referer-accept-encoding" |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 68 | txresp -hdr "Vary: referer,accept-encoding" \ |
| 69 | -hdr "Cache-Control: max-age=5" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 70 | -hdr "Content-Encoding: br" \ |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 71 | -bodylen 54 |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 72 | |
| 73 | rxreq |
| 74 | expect req.url == "/referer-accept-encoding" |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 75 | txresp -hdr "Vary: referer,accept-encoding" \ |
| 76 | -hdr "Cache-Control: max-age=5" \ |
| 77 | -hdr "Content-Encoding: gzip" \ |
| 78 | -bodylen 57 |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 79 | |
Remi Tricot-Le Breton | e4421de | 2020-12-23 18:13:46 +0100 | [diff] [blame] | 80 | # Multiple Accept-Encoding headers |
| 81 | rxreq |
| 82 | expect req.url == "/multiple_headers" |
| 83 | txresp -hdr "Vary: accept-encoding" \ |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 84 | -hdr "Cache-Control: max-age=5" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 85 | -hdr "Content-Encoding: br" \ |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 86 | -bodylen 155 |
Remi Tricot-Le Breton | e4421de | 2020-12-23 18:13:46 +0100 | [diff] [blame] | 87 | |
| 88 | rxreq |
| 89 | expect req.url == "/multiple_headers" |
| 90 | txresp -hdr "Vary: accept-encoding" \ |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 91 | -hdr "Cache-Control: max-age=5" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 92 | -hdr "Content-Encoding: br" \ |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 93 | -bodylen 166 |
Remi Tricot-Le Breton | e4421de | 2020-12-23 18:13:46 +0100 | [diff] [blame] | 94 | |
| 95 | |
| 96 | # Too many Accept-Encoding values (we will not cache responses with more than 16 encodings) |
| 97 | rxreq |
| 98 | expect req.url == "/too_many_encodings" |
| 99 | txresp -hdr "Vary: accept-encoding" \ |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 100 | -hdr "Cache-Control: max-age=5" \ |
| 101 | -hdr "Content-Encoding: gzip" \ |
| 102 | -bodylen 177 |
Remi Tricot-Le Breton | e4421de | 2020-12-23 18:13:46 +0100 | [diff] [blame] | 103 | |
| 104 | rxreq |
| 105 | expect req.url == "/too_many_encodings" |
| 106 | txresp -hdr "Vary: accept-encoding" \ |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 107 | -hdr "Cache-Control: max-age=5" \ |
| 108 | -hdr "Content-Encoding: gzip" \ |
| 109 | -bodylen 188 |
Remi Tricot-Le Breton | e4421de | 2020-12-23 18:13:46 +0100 | [diff] [blame] | 110 | |
Remi Tricot-Le Breton | 754b242 | 2020-11-16 15:56:10 +0100 | [diff] [blame] | 111 | |
| 112 | } -start |
| 113 | |
| 114 | server s2 { |
| 115 | # Responses that should not be cached |
| 116 | rxreq |
| 117 | expect req.url == "/no_vary_support" |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 118 | txresp -hdr "Vary: accept-encoding" \ |
| 119 | -hdr "Cache-Control: max-age=5" \ |
| 120 | -bodylen 57 |
Remi Tricot-Le Breton | 754b242 | 2020-11-16 15:56:10 +0100 | [diff] [blame] | 121 | |
| 122 | rxreq |
| 123 | expect req.url == "/no_vary_support" |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 124 | txresp -hdr "Vary: accept-encoding" \ |
| 125 | -hdr "Cache-Control: max-age=5" \ |
| 126 | -bodylen 57 |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 127 | } -start |
| 128 | |
| 129 | haproxy h1 -conf { |
Willy Tarreau | e1465c1 | 2021-05-09 14:41:41 +0200 | [diff] [blame] | 130 | global |
| 131 | # WT: limit false-positives causing "HTTP header incomplete" due to |
| 132 | # idle server connections being randomly used and randomly expiring |
| 133 | # under us. |
| 134 | tune.idle-pool.shared off |
| 135 | |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 136 | defaults |
| 137 | mode http |
| 138 | ${no-htx} option http-use-htx |
| 139 | timeout connect 1s |
| 140 | timeout client 1s |
| 141 | timeout server 1s |
| 142 | |
| 143 | frontend fe |
| 144 | bind "fd@${fe}" |
Remi Tricot-Le Breton | 754b242 | 2020-11-16 15:56:10 +0100 | [diff] [blame] | 145 | use_backend no_vary_be if { path_beg /no_vary_support } |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 146 | default_backend test |
| 147 | |
| 148 | backend test |
| 149 | http-request cache-use my_cache |
| 150 | server www ${s1_addr}:${s1_port} |
| 151 | http-response cache-store my_cache |
| 152 | http-response set-header X-Cache-Hit %[res.cache_hit] |
| 153 | |
Remi Tricot-Le Breton | 754b242 | 2020-11-16 15:56:10 +0100 | [diff] [blame] | 154 | backend no_vary_be |
| 155 | http-request cache-use no_vary_cache |
| 156 | server www ${s2_addr}:${s2_port} |
| 157 | http-response cache-store no_vary_cache |
| 158 | http-response set-header X-Cache-Hit %[res.cache_hit] |
| 159 | |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 160 | cache my_cache |
| 161 | total-max-size 3 |
| 162 | max-age 20 |
| 163 | max-object-size 3072 |
Remi Tricot-Le Breton | e6cc5b5 | 2020-12-23 18:13:53 +0100 | [diff] [blame] | 164 | process-vary on |
Remi Tricot-Le Breton | 754b242 | 2020-11-16 15:56:10 +0100 | [diff] [blame] | 165 | |
| 166 | cache no_vary_cache |
| 167 | total-max-size 3 |
| 168 | max-age 20 |
| 169 | max-object-size 3072 |
Remi Tricot-Le Breton | e6cc5b5 | 2020-12-23 18:13:53 +0100 | [diff] [blame] | 170 | process-vary off |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 171 | } -start |
| 172 | |
| 173 | |
| 174 | client c1 -connect ${h1_fe_sock} { |
| 175 | # Accept-Encoding Vary |
| 176 | txreq -url "/accept-encoding" -hdr "Accept-Encoding: first_value" |
| 177 | rxresp |
| 178 | expect resp.status == 200 |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 179 | expect resp.http.content-encoding == "gzip" |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 180 | expect resp.bodylen == 45 |
| 181 | |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 182 | # The response for the first request had an unacceptable `content-encoding` |
| 183 | # which might happen if that's the only thing the server supports, but |
| 184 | # we must not cache that and instead defer to the server. |
| 185 | txreq -url "/accept-encoding" -hdr "Accept-Encoding: first_value" |
| 186 | rxresp |
| 187 | expect resp.status == 200 |
| 188 | expect resp.http.content-encoding == "gzip" |
| 189 | expect resp.bodylen == 45 |
| 190 | expect resp.http.X-Cache-Hit == 0 |
| 191 | |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 192 | txreq -url "/accept-encoding" -hdr "Accept-Encoding: second_value" |
| 193 | rxresp |
| 194 | expect resp.status == 200 |
| 195 | expect resp.bodylen == 48 |
| 196 | expect resp.http.content-type == "text/plain" |
| 197 | expect resp.http.X-Cache-Hit == 0 |
| 198 | |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 199 | # This request matches the cache entry for the request above, despite |
| 200 | # matching the `accept-encoding` of the first request because the |
| 201 | # request above only has the `identity` encoding which is implicitly |
Ilya Shipitsin | 1e9a666 | 2021-01-05 22:10:46 +0500 | [diff] [blame] | 202 | # added, unless explicitly forbidden. |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 203 | txreq -url "/accept-encoding" -hdr "Accept-Encoding: first_value" |
| 204 | rxresp |
| 205 | expect resp.status == 200 |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 206 | expect resp.bodylen == 48 |
| 207 | expect resp.http.content-type == "text/plain" |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 208 | expect resp.http.X-Cache-Hit == 1 |
| 209 | |
| 210 | txreq -url "/accept-encoding" -hdr "Accept-Encoding: second_value" |
| 211 | rxresp |
| 212 | expect resp.status == 200 |
| 213 | expect resp.bodylen == 48 |
| 214 | expect resp.http.content-type == "text/plain" |
| 215 | expect resp.http.X-Cache-Hit == 1 |
| 216 | |
Remi Tricot-Le Breton | 8bb72aa | 2020-11-30 17:06:03 +0100 | [diff] [blame] | 217 | # The accept-encoding normalizer function converts the header values |
| 218 | # to lower case then calculates the hash of every sub part before |
| 219 | # sorting the hashes and xor'ing them (while removing duplicates). |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 220 | txreq -url "/accept-encoding-multiple" -hdr "Accept-Encoding: first,second" |
| 221 | rxresp |
| 222 | expect resp.status == 200 |
| 223 | expect resp.bodylen == 51 |
| 224 | expect resp.http.X-Cache-Hit == 0 |
| 225 | |
| 226 | txreq -url "/accept-encoding-multiple" -hdr "Accept-Encoding: first,second" |
| 227 | rxresp |
| 228 | expect resp.status == 200 |
| 229 | expect resp.bodylen == 51 |
| 230 | expect resp.http.X-Cache-Hit == 1 |
| 231 | |
| 232 | txreq -url "/accept-encoding-multiple" -hdr "Accept-Encoding: second,first" |
| 233 | rxresp |
| 234 | expect resp.status == 200 |
| 235 | expect resp.bodylen == 51 |
| 236 | expect resp.http.X-Cache-Hit == 1 |
| 237 | |
Remi Tricot-Le Breton | 8bb72aa | 2020-11-30 17:06:03 +0100 | [diff] [blame] | 238 | txreq -url "/accept-encoding-multiple" -hdr "Accept-Encoding: FirsT,SECOND,first" |
| 239 | rxresp |
| 240 | expect resp.status == 200 |
| 241 | expect resp.bodylen == 51 |
| 242 | expect resp.http.X-Cache-Hit == 1 |
| 243 | |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 244 | # Unmanaged vary |
| 245 | txreq -url "/unmanaged" -hdr "Accept-Encoding: first_value" |
| 246 | rxresp |
| 247 | expect resp.status == 200 |
| 248 | expect resp.bodylen == 51 |
| 249 | expect resp.http.X-Cache-Hit == 0 |
| 250 | |
| 251 | txreq -url "/unmanaged" -hdr "Accept-Encoding: first_value" |
| 252 | rxresp |
| 253 | expect resp.status == 200 |
| 254 | expect resp.bodylen == 51 |
| 255 | expect resp.http.X-Cache-Hit == 0 |
| 256 | |
| 257 | |
| 258 | # Mixed Vary (Accept-Encoding + Referer) |
| 259 | txreq -url "/referer-accept-encoding" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 260 | -hdr "Accept-Encoding: br, gzip" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 261 | -hdr "Referer: referer" |
| 262 | rxresp |
| 263 | expect resp.status == 200 |
| 264 | expect resp.bodylen == 51 |
| 265 | expect resp.http.X-Cache-Hit == 0 |
| 266 | |
| 267 | txreq -url "/referer-accept-encoding" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 268 | -hdr "Accept-Encoding: br" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 269 | -hdr "Referer: other-referer" |
| 270 | rxresp |
| 271 | expect resp.status == 200 |
| 272 | expect resp.bodylen == 54 |
| 273 | expect resp.http.X-Cache-Hit == 0 |
| 274 | |
| 275 | txreq -url "/referer-accept-encoding" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 276 | -hdr "Accept-Encoding: gzip" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 277 | -hdr "Referer: other-referer" |
| 278 | rxresp |
| 279 | expect resp.status == 200 |
| 280 | expect resp.bodylen == 57 |
| 281 | expect resp.http.X-Cache-Hit == 0 |
| 282 | |
| 283 | txreq -url "/referer-accept-encoding" \ |
| 284 | -hdr "Referer: referer" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 285 | -hdr "Accept-Encoding: gzip, br" |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 286 | rxresp |
| 287 | expect resp.status == 200 |
| 288 | expect resp.bodylen == 51 |
| 289 | expect resp.http.X-Cache-Hit == 1 |
| 290 | |
| 291 | txreq -url "/referer-accept-encoding" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 292 | -hdr "Accept-Encoding: br" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 293 | -hdr "Referer: other-referer" |
| 294 | rxresp |
| 295 | expect resp.status == 200 |
| 296 | expect resp.bodylen == 54 |
| 297 | expect resp.http.X-Cache-Hit == 1 |
| 298 | |
| 299 | txreq -url "/referer-accept-encoding" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 300 | -hdr "Accept-Encoding: gzip" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 301 | -hdr "Referer: other-referer" |
| 302 | rxresp |
| 303 | expect resp.status == 200 |
| 304 | expect resp.bodylen == 57 |
| 305 | expect resp.http.X-Cache-Hit == 1 |
Remi Tricot-Le Breton | 754b242 | 2020-11-16 15:56:10 +0100 | [diff] [blame] | 306 | |
Remi Tricot-Le Breton | e4421de | 2020-12-23 18:13:46 +0100 | [diff] [blame] | 307 | |
| 308 | # Multiple Accept-encoding headers |
| 309 | txreq -url "/multiple_headers" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 310 | -hdr "Accept-Encoding: gzip" \ |
| 311 | -hdr "Accept-Encoding: br, deflate" |
Remi Tricot-Le Breton | e4421de | 2020-12-23 18:13:46 +0100 | [diff] [blame] | 312 | rxresp |
| 313 | expect resp.status == 200 |
| 314 | expect resp.bodylen == 155 |
| 315 | expect resp.http.X-Cache-Hit == 0 |
| 316 | |
| 317 | txreq -url "/multiple_headers" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 318 | -hdr "Accept-Encoding: deflate" \ |
| 319 | -hdr "Accept-Encoding: br,gzip" |
Remi Tricot-Le Breton | e4421de | 2020-12-23 18:13:46 +0100 | [diff] [blame] | 320 | rxresp |
| 321 | expect resp.status == 200 |
| 322 | expect resp.bodylen == 155 |
| 323 | expect resp.http.X-Cache-Hit == 1 |
| 324 | |
| 325 | # Should not match a cache entry |
| 326 | txreq -url "/multiple_headers" \ |
| 327 | -hdr "Accept-Encoding: first_encoding" |
| 328 | rxresp |
| 329 | expect resp.status == 200 |
| 330 | expect resp.bodylen == 166 |
| 331 | expect resp.http.X-Cache-Hit == 0 |
| 332 | |
| 333 | # Too many accept encodings |
| 334 | txreq -url "/too_many_encodings" \ |
| 335 | -hdr "Accept-Encoding: a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17" |
| 336 | rxresp |
| 337 | expect resp.status == 200 |
| 338 | expect resp.bodylen == 177 |
| 339 | expect resp.http.X-Cache-Hit == 0 |
| 340 | |
| 341 | txreq -url "/too_many_encodings" \ |
| 342 | -hdr "Accept-Encoding: a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17" |
| 343 | rxresp |
| 344 | expect resp.status == 200 |
| 345 | expect resp.bodylen == 188 |
| 346 | expect resp.http.X-Cache-Hit == 0 |
| 347 | |
| 348 | |
Remi Tricot-Le Breton | 8bb72aa | 2020-11-30 17:06:03 +0100 | [diff] [blame] | 349 | # The following requests are treated by a backend that does not cache |
Remi Tricot-Le Breton | 754b242 | 2020-11-16 15:56:10 +0100 | [diff] [blame] | 350 | # responses containing a Vary header |
| 351 | txreq -url "/no_vary_support" |
| 352 | rxresp |
| 353 | expect resp.status == 200 |
| 354 | expect resp.bodylen == 57 |
| 355 | expect resp.http.X-Cache-Hit == 0 |
| 356 | |
| 357 | txreq -url "/no_vary_support" |
| 358 | rxresp |
| 359 | expect resp.status == 200 |
| 360 | expect resp.bodylen == 57 |
| 361 | expect resp.http.X-Cache-Hit == 0 |
| 362 | |
| 363 | |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 364 | } -run |