cache-manager
axios-cache-interceptor
cache-manager | axios-cache-interceptor | |
---|---|---|
1 | 10 | |
1,362 | 528 | |
1.9% | - | |
8.8 | 9.3 | |
6 days ago | 1 day ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cache-manager
-
I finally escaped Node (and you can too)
If you've come from java and you like node, maybe you should spend some time with the alternatives?
A big part of it depends on what your exact requirements are but my experience with node didn't bite me for quite a while.
1/2) my experience is that even the supported packages have had glaring holes where they don't in other languages. Just to give a quick example, I had a project that used node-cache-manager to implement a tiered cache. There was a bug (in the cache library with the most stars) just last year where the cached values in a memory cache were passed by reference as opposed to copied. That meant any mutation on them affected other fetches from the cache! That would never happen in java. This particular bug took weeks to debug in production because values were being randomly mutated. After the fix, it also had different behaviour for when the cache value was new vs when it was retrieved. So two mutation bugs in the same cache codebase see https://github.com/BryanDonovan/node-cache-manager/issues/13....
I'm not blaming the author, he's a really good guy. What i'm saying is this is a wart both in the language and the library ecosystem - it's not unreasonable to expect a sensible caching library.
3) I agree that threads aren't necessarily the way to go. But can we agree that a language that CAN efficiently take advantage of multiple cores would be better? It's not just for your application. It's also for any compiling eg. typescript!
> Just check out the recent GitHub report where they were accidentally leaking information from other users into their sessions.
Concurrency is hard! except in a language where it isn't. In elixir each "thread" (erlang process) would get a different copy of the data so this type of bug doesn't happen.
4.
> Typescript (combined with autogenerating typescript type files from GraphQL schema definitions) has been honestly heaven for us, and the benefits I've seen with the structural-based typing of TS made me realize the huge number of times I had to battle the nominal-based typing of Java and the immense pain that caused.
That is an interesting assessment. I've never really noticed a difference in practice between structural/nominal type systems to the extent that i didn't realise typescript was structural. Normally if you have multiple classes implementing the same structure, you want an interface anyway to make sure they don't diverge i.e. there is a higher purpose for them being the same.
Would you have an example of how this would be a deal breaker?
I think besides this aspect, Kotlin might be up your alley.
axios-cache-interceptor
-
How to implement algolia index on documentation?
Just done that to https://axios-cache-interceptor.js.org, you have to request in their oficial website if it is for a OSS project.
-
Make your apps cost efficient by caching APIs
To accomplish this, we will use the library axios-cache-interceptor to “cache API calls to reduce the number of credits we use”. For this caching option we need to see the lifetime of a cached response, a way to persist the day permanently and across different user sessions and, keep in mind, the margin to consider for cutting expenses.
- [AskJS] JavaScript Libraries
- Finally: The solution for when the issue doesn't have sufficient information.
-
[AskJS] How do people manage complex data and server interactions without classes or ORM in an SPA? Where is my Backbone for React?
You can use a good and easy to use request library, like axios (~5.6Kb) to make http requests, and a cache library, like axios-cache-interceptor (~3.84Kb, which i'm the maintainer btw), and let the cache plugin to take care of invalidating, requesting and storing it's data.
-
You should use cache over state for network requests. With Axios Cache Interceptor, this is made simple!
Documentation: https://axios-cache-interceptor.js.org
Github - Documentation - Npm - Bundlephobia
- I made an cache system for axios that supports multiple strategies, like Etag, Cache-Control, If-Modified-Since, Age and etc. It is fully customizable, with 100% Code coverage, only 4Kb minzipped and has custom typings for auto completion!
What are some alternatives?
proposal-temporal - Provides standard objects and functions for working with dates and times.
zustand - 🐻 Bear necessities for state management in React
node-lru-cache - A fast cache that automatically deletes the least recently used items
Recoil - Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.
FrameworkBenchmarks - Source for the TechEmpower Framework Benchmarks project
use-http - 🐶 React hook for making isomorphic http requests
DenoStore - GraphQL caching solution for a Deno/Oak runtime environment that is modular, efficient and lightweight
cacheable-request - Wrap native HTTP requests with RFC compliant cache support
axios - Promise based HTTP client for the browser and node.js
AxleJS - Fetch, supercharged.
tw-classed