response_cache: an immutable response is always fresh

This commit is contained in:
HoneyryderChuck 2025-04-04 23:58:04 +01:00
parent 5c2f8ab0b1
commit 3df6edbcfc

View File

@ -140,6 +140,8 @@ module HTTPX
if cache_control
return false if cache_control.include?("no-cache")
return true if cache_control.include?("immutable")
# check age: max-age
max_age = cache_control.find { |directive| directive.start_with?("s-maxage") }