11 Commits

Author SHA1 Message Date
HoneyryderChuck
7173616154 response cache: fix vary header handling by supporting a defined set of headers
the cache key will be also determined by the supported vary headers values, when present; this means easier lookups, and one level hash fetch, where the same url-verb request may have multiple entries depending on those headers

checking response vary header will therefore be something done at cache response lookup; writes may override when they shouldn't though, as a full match on supported vary headers will be performed, and one can't know in advance the combo of vary headers, which is why insterested parties will have to be judicious with the new  option
2025-04-12 22:09:12 +01:00
HoneyryderChuck
339af65cc1 response cache: store cached response in request, so that copying and cache invalidating work a bit OOTB 2025-04-12 22:09:12 +01:00
HoneyryderChuck
5c2f8ab0b1 response_cache plugin: return cached response from store unless stale
response age wasn't being taken into account, and cache invalidation request was always being sent; fresh response will stay in the store until expired; when it expires, cache invalidation will be tried (if possible); if invalidated, the new response is put in the store; Bif validated, the body of the cached response is copied, and the cached response stays in the store
2025-04-12 22:09:11 +01:00
HoneyryderChuck
ee229aa74c readapt some plugins so that supported verbs can be overridden by custom plugins 2025-04-04 09:32:38 +01:00
Earlopain
ac21f563de Remove dependency on mutex_m 2023-11-16 12:38:22 +00:00
HoneyryderChuck
09be632cd9 circuit breaker: use Enumerator#with_object, treat uris as strings to avoid allocation 2023-09-29 10:29:09 +01:00
HoneyryderChuck
0555132740 integrate mutex_m in signatures 2023-06-12 20:42:57 +01:00
HoneyryderChuck
092e594a4b Request.verb is now an upcased string (ex: "GET")
The reference for a request verb is now the string which is used
everywhere else, instead of the symbol corresponding to it. This was an
artifact from the import from httprb, and there is no advantage in it,
since these strings are frozen in most use cases, and the
transformations from symbol to strings being performed everywhere are
prooof that keeping the atom isn't really bringing any benefit.
2023-04-17 16:54:31 +03:00
HoneyryderChuck
61c36c4ef9 response cache: caching several instances for the same URL
by relying on vary header, this should have the effect of not
overflowinng, and doing what the user wants.
2022-08-01 18:40:21 +01:00
HoneyryderChuck
32a81f2025 fix: response cache now also takes verb into account when caching
The previous strategy was working only with URLs. This strategy would
fall flat if the same url could be used with several HTTP verbs.
2022-07-31 17:03:30 +01:00
HoneyryderChuck
a3ee98f410 implementation of the response cache plugin 2021-10-01 23:53:21 +01:00