mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
response_cache plugin: rename cached_response? to not_modified?, more accurate
This commit is contained in:
parent
f328646c08
commit
32031e8a03
@ -37,7 +37,7 @@ module HTTPX
|
||||
response.status != 206
|
||||
end
|
||||
|
||||
def cached_response?(response)
|
||||
def not_modified?(response)
|
||||
response.is_a?(Response) && response.status == 304
|
||||
end
|
||||
|
||||
@ -93,7 +93,7 @@ module HTTPX
|
||||
|
||||
return unless response
|
||||
|
||||
if ResponseCache.cached_response?(response)
|
||||
if ResponseCache.not_modified?(response)
|
||||
log { "returning cached response for #{request.uri}" }
|
||||
|
||||
response.copy_from_cached!
|
||||
|
@ -6,7 +6,8 @@ module HTTPX
|
||||
SUPPORTED_VARY_HEADERS: Array[String]
|
||||
|
||||
def self?.cacheable_response?: (::HTTPX::ErrorResponse | cacheResponse response) -> bool
|
||||
def self?.cached_response?: (response response) -> bool
|
||||
|
||||
def self?.not_modified?: (response response) -> bool
|
||||
|
||||
interface _ResponseCacheOptions
|
||||
def response_cache_store: () -> Store
|
||||
|
Loading…
x
Reference in New Issue
Block a user