Comments (8)
I will love if new GOT works perfectly fine with streams including caching. Our use-case is that our responses must be streams, whether they are cached or not. Basically the files we are requesting are huge so it's always preferred to keep stream rather than convert to buffer.
from cacheable.
I am ready to implement all of the changes in this library and do major refactor but @lukechilds seems to be taking too much time merging PRs. This library also has many problems:
- messed up codebase. super hard to understand
- got.stream when used in conjunction with cacheable request, the cached response always is buffer because how the responselike library used by this cacheable-request handles it poorly: https://github.com/lukechilds/responselike/blob/master/src/index.js
- minor caching bugs here and there which I don't exactly remember.
As a result I have created a fork: https://github.com/gumlet/cacheable-request
I maintain it and if GOT wishes, they can migrate to that module: https://www.npmjs.com/package/improved-cacheable-request
I love GOT and I am ready to implement the required changes in my library for GOT v10. If nothing works, at least provide an option in GOT with which, we can easily switch the cacheable-request library.
from cacheable.
messed up codebase. super hard to understand
I disagree :P It's not that hard 😉
got.stream when used in conjunction with cacheable request, the cached response always is buffer because how the responselike library used by this cacheable-request handles it poorly:
I don't think you can cache the response without downloading the body first...
I maintain it and if GOT wishes, they can migrate to that module
That won't be necessary. I'm gonna redesign this module once I've finished my current work on Got.
from cacheable.
I love GOT and I am ready to implement the required changes in my library for GOT v10.
Well, you could override the request
option for now...
from cacheable.
@szmarczak It's hard compared to my redesigned codebase.
The problem is actually not the download part. There it's handled very well. The problem is that responselike module is designed in such a way that even if a cache adapter is able to return stream while retrieving from cache, the responselike module forbids it. Any cache must return buffer and then responselike module converts it to stream in ugly way.
It would be awesome if you redesign this module (actually I like the fact that you agree that re-design is necessary). Please let us know if any redesign is there in your mind. I (and my company) would love to offer our axe for any amount of work which can improve this module.
from cacheable.
the responselike module forbids it
You can use to-readable-stream
.
I (and my company) would love to offer our axe for any amount of work which can improve this module.
I'll post here when I start :)
from cacheable.
@szmarczak let me know if you are ready to start. I am sorry to be pushy but this library is super critical for our project so want to get it improved as soon as possible,
from cacheable.
closing this out as we are now working to support Node 12, 14, 16, and 18. Should be updated in the next 90 days.
from cacheable.
Related Issues (20)
- Upgrading xo package to ^0.49.0
- Migrating to Typescript
- Make proper changelogs HOT 1
- Hooks should be per-instance HOT 3
- Fail to run the test HOT 3
- Types needs to be updated for ESM HOT 2
- Cannot use namespace 'ResponseLike' as a type. HOT 18
- Could not find a declaration file for module 'http-cache-semantics' HOT 2
- [regression] Could not find a declaration file for module 'http-cache-semantics' HOT 3
- Memory leak HOT 4
- [question] security fix for http-cache-semantics 4.1.1 in v8 HOT 13
- memory leak in got@11 HOT 14
- Regular Expression Denial of Service (ReDoS) Vulnerability Found in a Package
- 7.0.3 Deployment now expects Node Version > 14, breaking change. HOT 9
- Nodejs version 20 creates error with Request
- [email protected] requires Node.js >= 16 HOT 4
- Sourcemaps point to missing source files HOT 2
- When upgrading to latest get-stream it is no longer compatible with nodejs 16
- LICENSE text (MIT) missing in npm module HOT 1
- Thoughts on using standardized web Request / Response / Headers? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cacheable.