online / endpoints 59 / categories 14 / rate 60/min/ip /

GET /cache-confused

GET /cache-confused

Sends contradictory Cache-Control directives. Default bundles three contradictions in one header (no-store with max-age, no-cache with immutable, private with s-maxage). Use ?mode= to test how a specific RFC 9111 conflict is resolved by your cache or proxy.

mode Which contradiction. One of: all (default), store-vs-age (no-store + max-age=300), cache-vs-immutable (no-cache + immutable), private-vs-shared (private + s-maxage=3600).

control Compare against the well-formed counterpart: not.catastrophic.io/cache-confused side-by-side

build a request:

expect: 200 OK with a Cache-Control header containing contradictory directives. How any given cache resolves it is implementation-defined.

bash
curl -i 'https://chaos.catastrophic.io/cache-confused?mode=all'
import urllib.request
resp = urllib.request.urlopen("https://chaos.catastrophic.io/cache-confused?mode=all")
print(resp.headers["Cache-Control"])
const res = await fetch("https://chaos.catastrophic.io/cache-confused?mode=all");
console.log(res.headers.get("cache-control"));
package main

import (
    "fmt"
    "net/http"
)

func main() {
    resp, _ := http.Get("https://chaos.catastrophic.io/cache-confused?mode=all")
    defer resp.Body.Close()
    fmt.Println(resp.Header.Get("Cache-Control"))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["blocking"] }
fn main() -> Result<(), Box> {
    let resp = reqwest::blocking::get("https://chaos.catastrophic.io/cache-confused?mode=all")?;
    println!("{:?}", resp.headers().get("cache-control"));
    Ok(())
}
import java.net.URI;
import java.net.http.*;

public class CacheConfused {
    public static void main(String[] args) throws Exception {
        var client = HttpClient.newHttpClient();
        var req = HttpRequest.newBuilder(URI.create("https://chaos.catastrophic.io/cache-confused?mode=all")).build();
        var resp = client.send(req, HttpResponse.BodyHandlers.discarding());
        System.out.println(resp.headers().firstValue("Cache-Control").orElse(""));
    }
}
using var client = new HttpClient();
var resp = await client.GetAsync("https://chaos.catastrophic.io/cache-confused?mode=all");
Console.WriteLine(resp.Headers.CacheControl);
require "net/http"
res = Net::HTTP.get_response(URI("https://chaos.catastrophic.io/cache-confused?mode=all"))
puts res["Cache-Control"]
$r = Invoke-WebRequest -Uri 'https://chaos.catastrophic.io/cache-confused?mode=all'
$r.Headers['Cache-Control']