online / endpoints 62 / categories 10 / rate 60/min/ip /

GET /cache-coherent

GET /cache-coherent alias: /cache-confused

Returns a single, sensible Cache-Control directive (`public, max-age=300`). Counterpart to the chaos /cache-confused endpoint, which combines mutually contradictory directives.

expect: 200 OK with a single Cache-Control: public, max-age=300 directive. No contradictions.

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

import (
    "fmt"
    "net/http"
)

func main() {
    resp, _ := http.Get("https://not.catastrophic.io/cache-coherent")
    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://not.catastrophic.io/cache-coherent")?;
    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://not.catastrophic.io/cache-coherent")).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://not.catastrophic.io/cache-coherent");
Console.WriteLine(resp.Headers.CacheControl);
require "net/http"
res = Net::HTTP.get_response(URI("https://not.catastrophic.io/cache-coherent"))
puts res["Cache-Control"]
$r = Invoke-WebRequest -Uri 'https://not.catastrophic.io/cache-coherent'
$r.Headers['Cache-Control']