blob: 37bc2464caa17de1851671c62ec995590e0aef57 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
meta:
version: "1.0"
urtest:
description: "Serve a cached ESI response after an origin 304"
requires:
plugins: ["esi.so"]
server:
name: "esi-304-origin"
client:
name: "esi-304-client"
ats:
name: "esi-304-ts"
records_config:
proxy.config.diags.debug.enabled: 1
proxy.config.diags.debug.tags: "http|plugin_esi"
plugin_config:
- "esi.so --private-response"
remap_config:
- from: "http://www.example.com/"
to: "http://127.0.0.1:{SERVER_HTTP_PORT}/"
sessions:
- transactions:
- client-request:
method: GET
version: "1.1"
url: /esi_etag.php
headers:
fields:
- [Host, www.example.com]
- [Accept, "*/*"]
- [uuid, first]
proxy-request:
headers:
fields:
- [uuid, {value: first, as: equal}]
server-response:
status: 200
reason: OK
headers:
fields:
- [X-Esi, "1"]
- [Cache-Control, "public, max-age=0"]
- [Etag, '"esi_304_test"']
- [Content-Type, text/html]
- [Connection, close]
content:
data: "<html>\n<body>\nHello, ESI 304 test\n</body>\n</html>\n"
proxy-response:
status: 200
headers:
fields:
- [Cache-Control, {value: "max-age=0, private", as: equal}]
content:
size: {value: 50, as: equal}
- client-request:
method: GET
version: "1.1"
url: /esi_etag.php
headers:
fields:
- [Host, www.example.com]
- [Accept, "*/*"]
- [uuid, second]
proxy-request:
headers:
fields:
- [uuid, {value: second, as: equal}]
- [If-None-Match, {value: '"esi_304_test"', as: equal}]
server-response:
status: 304
reason: Not Modified
headers:
fields:
- [Content-Type, text/html]
- [Connection, close]
- [Content-Length, "0"]
proxy-response:
status: 200
headers:
fields:
- [Cache-Control, {value: "max-age=0, private", as: equal}]
content:
verify: {as: equal}
data: "<html>\n<body>\nHello, ESI 304 test\n</body>\n</html>\n"