Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: http caching Implements bare-bones http caching as per rfc9111 Closes #3231 Closes #2760 Closes #2256 Closes #1146 Co-authored-by: Carlos Fuentes <me@metcoder.dev> Co-authored-by: Robert Nagy <ronagy@icloud.com> Co-authored-by: Isak Törnros <isak.tornros@hotmail.com> Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * fixup! feat: http caching Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * fixup! fixup! feat: http caching Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * fixup! fixup! fixup! feat: http caching Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Update lib/handler/cache-handler.js Co-authored-by: Robert Nagy <ronagy@icloud.com> * Apply suggestions from code review Co-authored-by: Carlos Fuentes <me@metcoder.dev> * fixup! fixup! fixup! fixup! feat: http caching Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * fixup! fixup! fixup! fixup! fixup! feat: http caching Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * clarify type for MemoryCacheStore Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> * Apply suggestions from code review Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> * tmp Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * fixup! tmp Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> * perf things, deleteByOrigin Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * incredibly messy and broken impl of streaming idea Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * fix tests Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * check if the response is already cached again Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * backpressure patch Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * move body out of CacheStoreValue, remove size property Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Robert Nagy <ronagy@icloud.com> * add some comments on createWriteStream Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * fix type tests, make staleAt and deleteAt absolute Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * empty the body when overwriting the response Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * update onError calls Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * remove request deduplication for now Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * rename value -> opts, storedValue -> value Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * fix types Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Matteo Collina <matteo.collina@gmail.com> * simplify parsing for qualified no-cache and private Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * fix header omission, some cleanup Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * running the tests in ci is probably a good idea Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * fix some testing values Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * fixup! running the tests in ci is probably a good idea Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Update lib/interceptor/cache.js Co-authored-by: Robert Nagy <ronagy@icloud.com> * Update lib/util/cache.js Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> * update from reviews Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Update lib/interceptor/cache.js Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> * Apply suggestions from code review Co-authored-by: Robert Nagy <ronagy@icloud.com> * change from reviews Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * add promise support back for createReadStream Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Robert Nagy <ronagy@icloud.com> * check if onError was called Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * add docs Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * add errorCallback Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Update types/cache-interceptor.d.ts Co-authored-by: Carlos Fuentes <me@metcoder.dev> * use fake timers and cleanup client Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * lazy cache wellknown headers Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> * Update lib/cache/memory-cache-store.js Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> * code review Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> * Apply suggestions from code review Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> * code review pt2 Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> * Update lib/handler/cache-revalidation-handler.js Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> * Update lib/handler/cache-handler.js Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> * Apply suggestions from code review * fix --------- Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> Co-authored-by: Robert Nagy <ronagy@icloud.com> Co-authored-by: Carlos Fuentes <me@metcoder.dev> Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com> Co-authored-by: Matteo Collina <matteo.collina@gmail.com>
- Loading branch information