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 { |
| 130 | defaults |
| 131 | mode http |
| 132 | ${no-htx} option http-use-htx |
| 133 | timeout connect 1s |
| 134 | timeout client 1s |
| 135 | timeout server 1s |
| 136 | |
| 137 | frontend fe |
| 138 | bind "fd@${fe}" |
Remi Tricot-Le Breton | 754b242 | 2020-11-16 15:56:10 +0100 | [diff] [blame] | 139 | 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] | 140 | default_backend test |
| 141 | |
| 142 | backend test |
| 143 | http-request cache-use my_cache |
| 144 | server www ${s1_addr}:${s1_port} |
| 145 | http-response cache-store my_cache |
| 146 | http-response set-header X-Cache-Hit %[res.cache_hit] |
| 147 | |
Remi Tricot-Le Breton | 754b242 | 2020-11-16 15:56:10 +0100 | [diff] [blame] | 148 | backend no_vary_be |
| 149 | http-request cache-use no_vary_cache |
| 150 | server www ${s2_addr}:${s2_port} |
| 151 | http-response cache-store no_vary_cache |
| 152 | http-response set-header X-Cache-Hit %[res.cache_hit] |
| 153 | |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 154 | cache my_cache |
| 155 | total-max-size 3 |
| 156 | max-age 20 |
| 157 | max-object-size 3072 |
Remi Tricot-Le Breton | e6cc5b5 | 2020-12-23 18:13:53 +0100 | [diff] [blame] | 158 | process-vary on |
Remi Tricot-Le Breton | 754b242 | 2020-11-16 15:56:10 +0100 | [diff] [blame] | 159 | |
| 160 | cache no_vary_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 off |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 165 | } -start |
| 166 | |
| 167 | |
| 168 | client c1 -connect ${h1_fe_sock} { |
| 169 | # Accept-Encoding Vary |
| 170 | txreq -url "/accept-encoding" -hdr "Accept-Encoding: first_value" |
| 171 | rxresp |
| 172 | expect resp.status == 200 |
Remi Tricot-Le Breton | b054b6d | 2020-12-23 18:13:50 +0100 | [diff] [blame] | 173 | expect resp.http.content-encoding == "gzip" |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 174 | expect resp.bodylen == 45 |
| 175 | |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 176 | # The response for the first request had an unacceptable `content-encoding` |
| 177 | # which might happen if that's the only thing the server supports, but |
| 178 | # we must not cache that and instead defer to the server. |
| 179 | txreq -url "/accept-encoding" -hdr "Accept-Encoding: first_value" |
| 180 | rxresp |
| 181 | expect resp.status == 200 |
| 182 | expect resp.http.content-encoding == "gzip" |
| 183 | expect resp.bodylen == 45 |
| 184 | expect resp.http.X-Cache-Hit == 0 |
| 185 | |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 186 | txreq -url "/accept-encoding" -hdr "Accept-Encoding: second_value" |
| 187 | rxresp |
| 188 | expect resp.status == 200 |
| 189 | expect resp.bodylen == 48 |
| 190 | expect resp.http.content-type == "text/plain" |
| 191 | expect resp.http.X-Cache-Hit == 0 |
| 192 | |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 193 | # This request matches the cache entry for the request above, despite |
| 194 | # matching the `accept-encoding` of the first request because the |
| 195 | # request above only has the `identity` encoding which is implicitly |
Ilya Shipitsin | 1e9a666 | 2021-01-05 22:10:46 +0500 | [diff] [blame] | 196 | # added, unless explicitly forbidden. |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 197 | txreq -url "/accept-encoding" -hdr "Accept-Encoding: first_value" |
| 198 | rxresp |
| 199 | expect resp.status == 200 |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 200 | expect resp.bodylen == 48 |
| 201 | expect resp.http.content-type == "text/plain" |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 202 | expect resp.http.X-Cache-Hit == 1 |
| 203 | |
| 204 | txreq -url "/accept-encoding" -hdr "Accept-Encoding: second_value" |
| 205 | rxresp |
| 206 | expect resp.status == 200 |
| 207 | expect resp.bodylen == 48 |
| 208 | expect resp.http.content-type == "text/plain" |
| 209 | expect resp.http.X-Cache-Hit == 1 |
| 210 | |
Remi Tricot-Le Breton | 8bb72aa | 2020-11-30 17:06:03 +0100 | [diff] [blame] | 211 | # The accept-encoding normalizer function converts the header values |
| 212 | # to lower case then calculates the hash of every sub part before |
| 213 | # sorting the hashes and xor'ing them (while removing duplicates). |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 214 | txreq -url "/accept-encoding-multiple" -hdr "Accept-Encoding: first,second" |
| 215 | rxresp |
| 216 | expect resp.status == 200 |
| 217 | expect resp.bodylen == 51 |
| 218 | expect resp.http.X-Cache-Hit == 0 |
| 219 | |
| 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 == 1 |
| 225 | |
| 226 | txreq -url "/accept-encoding-multiple" -hdr "Accept-Encoding: second,first" |
| 227 | rxresp |
| 228 | expect resp.status == 200 |
| 229 | expect resp.bodylen == 51 |
| 230 | expect resp.http.X-Cache-Hit == 1 |
| 231 | |
Remi Tricot-Le Breton | 8bb72aa | 2020-11-30 17:06:03 +0100 | [diff] [blame] | 232 | txreq -url "/accept-encoding-multiple" -hdr "Accept-Encoding: FirsT,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 | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 238 | # Unmanaged vary |
| 239 | txreq -url "/unmanaged" -hdr "Accept-Encoding: first_value" |
| 240 | rxresp |
| 241 | expect resp.status == 200 |
| 242 | expect resp.bodylen == 51 |
| 243 | expect resp.http.X-Cache-Hit == 0 |
| 244 | |
| 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 | |
| 252 | # Mixed Vary (Accept-Encoding + Referer) |
| 253 | txreq -url "/referer-accept-encoding" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 254 | -hdr "Accept-Encoding: br, gzip" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 255 | -hdr "Referer: referer" |
| 256 | rxresp |
| 257 | expect resp.status == 200 |
| 258 | expect resp.bodylen == 51 |
| 259 | expect resp.http.X-Cache-Hit == 0 |
| 260 | |
| 261 | txreq -url "/referer-accept-encoding" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 262 | -hdr "Accept-Encoding: br" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 263 | -hdr "Referer: other-referer" |
| 264 | rxresp |
| 265 | expect resp.status == 200 |
| 266 | expect resp.bodylen == 54 |
| 267 | expect resp.http.X-Cache-Hit == 0 |
| 268 | |
| 269 | txreq -url "/referer-accept-encoding" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 270 | -hdr "Accept-Encoding: gzip" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 271 | -hdr "Referer: other-referer" |
| 272 | rxresp |
| 273 | expect resp.status == 200 |
| 274 | expect resp.bodylen == 57 |
| 275 | expect resp.http.X-Cache-Hit == 0 |
| 276 | |
| 277 | txreq -url "/referer-accept-encoding" \ |
| 278 | -hdr "Referer: referer" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 279 | -hdr "Accept-Encoding: gzip, br" |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 280 | rxresp |
| 281 | expect resp.status == 200 |
| 282 | expect resp.bodylen == 51 |
| 283 | expect resp.http.X-Cache-Hit == 1 |
| 284 | |
| 285 | txreq -url "/referer-accept-encoding" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 286 | -hdr "Accept-Encoding: br" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 287 | -hdr "Referer: other-referer" |
| 288 | rxresp |
| 289 | expect resp.status == 200 |
| 290 | expect resp.bodylen == 54 |
| 291 | expect resp.http.X-Cache-Hit == 1 |
| 292 | |
| 293 | txreq -url "/referer-accept-encoding" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 294 | -hdr "Accept-Encoding: gzip" \ |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 295 | -hdr "Referer: other-referer" |
| 296 | rxresp |
| 297 | expect resp.status == 200 |
| 298 | expect resp.bodylen == 57 |
| 299 | expect resp.http.X-Cache-Hit == 1 |
Remi Tricot-Le Breton | 754b242 | 2020-11-16 15:56:10 +0100 | [diff] [blame] | 300 | |
Remi Tricot-Le Breton | e4421de | 2020-12-23 18:13:46 +0100 | [diff] [blame] | 301 | |
| 302 | # Multiple Accept-encoding headers |
| 303 | txreq -url "/multiple_headers" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 304 | -hdr "Accept-Encoding: gzip" \ |
| 305 | -hdr "Accept-Encoding: br, deflate" |
Remi Tricot-Le Breton | e4421de | 2020-12-23 18:13:46 +0100 | [diff] [blame] | 306 | rxresp |
| 307 | expect resp.status == 200 |
| 308 | expect resp.bodylen == 155 |
| 309 | expect resp.http.X-Cache-Hit == 0 |
| 310 | |
| 311 | txreq -url "/multiple_headers" \ |
Tim Duesterhus | dc38bc4 | 2020-12-29 12:43:53 +0100 | [diff] [blame] | 312 | -hdr "Accept-Encoding: deflate" \ |
| 313 | -hdr "Accept-Encoding: br,gzip" |
Remi Tricot-Le Breton | e4421de | 2020-12-23 18:13:46 +0100 | [diff] [blame] | 314 | rxresp |
| 315 | expect resp.status == 200 |
| 316 | expect resp.bodylen == 155 |
| 317 | expect resp.http.X-Cache-Hit == 1 |
| 318 | |
| 319 | # Should not match a cache entry |
| 320 | txreq -url "/multiple_headers" \ |
| 321 | -hdr "Accept-Encoding: first_encoding" |
| 322 | rxresp |
| 323 | expect resp.status == 200 |
| 324 | expect resp.bodylen == 166 |
| 325 | expect resp.http.X-Cache-Hit == 0 |
| 326 | |
| 327 | # Too many accept encodings |
| 328 | txreq -url "/too_many_encodings" \ |
| 329 | -hdr "Accept-Encoding: a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17" |
| 330 | rxresp |
| 331 | expect resp.status == 200 |
| 332 | expect resp.bodylen == 177 |
| 333 | expect resp.http.X-Cache-Hit == 0 |
| 334 | |
| 335 | txreq -url "/too_many_encodings" \ |
| 336 | -hdr "Accept-Encoding: a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17" |
| 337 | rxresp |
| 338 | expect resp.status == 200 |
| 339 | expect resp.bodylen == 188 |
| 340 | expect resp.http.X-Cache-Hit == 0 |
| 341 | |
| 342 | |
Remi Tricot-Le Breton | 8bb72aa | 2020-11-30 17:06:03 +0100 | [diff] [blame] | 343 | # 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] | 344 | # responses containing a Vary header |
| 345 | txreq -url "/no_vary_support" |
| 346 | rxresp |
| 347 | expect resp.status == 200 |
| 348 | expect resp.bodylen == 57 |
| 349 | expect resp.http.X-Cache-Hit == 0 |
| 350 | |
| 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 | |
Remi Tricot-Le Breton | 1785f3d | 2020-11-16 15:56:09 +0100 | [diff] [blame] | 358 | } -run |