axios-cache-adapter icon indicating copy to clipboard operation
axios-cache-adapter copied to clipboard

v3

Open ghost opened this issue 6 years ago • 11 comments

:rocket: This is a first draft for the v3

Breaking changes

  • Cache requests which have query parameters by default
  • Simplified cache exclusion via middlewares
  • Pre-built excludeQuery(), excludePaths([/path-to-exclude-regexp/]) and excludeHttpMethods(['post', 'patch', 'put', 'delete']) exclusion middlewares
  • Only GET requests are cached by default
  • Cache non GET requests with a custom exclusion config (Fixes #92)
  • Response containing arraybuffers and blobs are cached by default (Fixes #82)

Bug fix

  • Handle cache-control: must-revalidate and store it with maxAge = Date.now() (Fixes #86)

Refactor

  • Moved adapter code into its own file

Docs

  • Rewrite of readme (Fixes #95)

Also trying to implement ideas from #57

ghost avatar May 24 '19 21:05 ghost

Codecov Report

Merging #94 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #94   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          10     11    +1     
  Lines         139    144    +5     
=====================================
+ Hits          139    144    +5
Impacted Files Coverage Δ
src/config.js 100% <ø> (ø) :arrow_up:
src/cache.js 100% <100%> (ø) :arrow_up:
src/adapter.js 100% <100%> (ø)
src/request.js 100% <100%> (ø) :arrow_up:
src/index.js 100% <100%> (ø) :arrow_up:
src/response.js 100% <100%> (ø) :arrow_up:
src/exclude.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 64ac601...591c0eb. Read the comment docs.

codecov[bot] avatar May 24 '19 21:05 codecov[bot]

@RasCarlito When this awesome changes would be released?

mohamedgomran avatar Jun 03 '19 13:06 mohamedgomran

@mohamedgomran Soon I hope, still need to spend some time changing some parts and updating the docs 😄

ghost avatar Jun 07 '19 08:06 ghost

Just published to npm as beta version

Try it out using npm install axios-cache-adapter@beta 🚀

ghost avatar Jul 15 '19 22:07 ghost

@RasCarlito - thoughts on when this will be merged to Master?

0xnirmal avatar Mar 31 '20 23:03 0xnirmal

@RasCarlito Having the ability to cache binaries saved my skin today! I am so happy it was just a pre-release update! Thank you so much for this incredible work.

gnarhard avatar Jun 19 '20 23:06 gnarhard

@RasCarlito Any updates on merging this?

kentr avatar Sep 04 '20 06:09 kentr

I will start working on this project again. I have been focused on my own life for the past year. Sorry I had no time/energy to give back to the community. I should have tried giving control to someone else while I was unavailable but oh well. Hopefully it will now move forward.

ghost avatar Feb 01 '21 11:02 ghost

@RasCarlito I can help if there is any pending features

mohamedgomran avatar Feb 01 '21 19:02 mohamedgomran

@RasCarlito Willing to help you where ever I can, if there's anything, please don't hesitate. This project has been a core deliverable for my work, and would love to give back some of my time.

jahead avatar May 11 '21 08:05 jahead

@RasCarlito any updates on this? I tried with the beta version but it gives an error. It would be really great if you could complete this. Will be very helpful to the community. I am ready to help in any manner.

rdpatel3996 avatar Aug 24 '22 05:08 rdpatel3996