# HTTP cache (S006): a stylesheet sent with `Cache-Control: max-age=3600` is fetched once for two visits.
# Offline. Start the server first:  python3 tests/smoke/cache/server.py &  then  tools/smoke.sh tests/smoke/cache.txt
wait 3
open http://127.0.0.1:8765/
waitfor 20 document.title === "Cache" && getComputedStyle(document.body).backgroundColor === "rgb(34, 170, 119)"
open @PAGES@/hello.html
waitload
open http://127.0.0.1:8765/
waitfor 20 document.title === "Cache" && getComputedStyle(document.body).backgroundColor === "rgb(34, 170, 119)"
js fetch("/count").then(r => r.text()).then(t => { window.count = t; })
waitfor 5 window.count !== undefined
js window.count
assert window.count === "1"
status done
quit
