Comments (8)
Let me think about that.. That's quite a jump for a 6kb library. It drags along crypto
which is pretty big. I feel like the benefit we gain from adding this compare to what we lose is smaller and is something that can be mitigated by a better documentation, i.e - if you want your cache to resolved properly for object parameters, they should have the same shape.
from ts-cacheable.
There is an option to specify a different cache resolver already. You can just supply a cacheResolver
to the config.
from ts-cacheable.
yes, I know, but this allows someone to use the hash resolver with just a simple config option
from ts-cacheable.
How much does this increase the bundle size of the decorator?
from ts-cacheable.
master: -rw-rw-r-- 1 jmls jmls 5894 Sep 27 09:06 cacheable.decorator.js
branch: -rw-rw-r-- 1 jmls jmls 6181 Sep 27 09:59 cacheable.decorator.js
although I forgot to yarn build
(didn't realise that dist was part of the package) (done, added to pr)
from ts-cacheable.
Yeah I was thinking more of the whole footprint of the object-hash
library. Can you measure it within a real app.. Don't want to increase the footprint for everyone for such a small change :)
from ts-cacheable.
ok, so I did a ng new
and added the app.component constructor to read
constructor() {
console.log(foobar123');
}
then did a prod build
$ ng build --prod
Date: 2018-09-27T09:11:45.976Z
Hash: 4b65c350709b5d29e44d
Time: 16208ms
chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] [rendered]
chunk {1} styles.34c57ab7888ec1573f9c.css (styles) 0 bytes [initial] [rendered]
chunk {2} polyfills.2f4a59095805af02bd79.js (polyfills) 59.6 kB [initial] [rendered]
chunk {3} main.2001cec6f9fda3d94344.js (main) 172 kB [initial] [rendered]
Done in 18.49s.
I then added the object-hash
import , and changed the constructor to read
constructor() {
console.log(hash('foobar123'));
}
and build prod again
jmls@jmls-MS-7641:/media/jmls/data/development/testhash$ yarn build --prod
yarn run v1.7.0
warning ../package.json: No license field
$ ng build --prodDate: 2018-09-27T09:13:13.714Z
Hash: 33c8205dddc2b6e00526
Time: 18647ms
chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] [rendered]
chunk {1} styles.34c57ab7888ec1573f9c.css (styles) 0 bytes [initial] [rendered]
chunk {2} polyfills.2f4a59095805af02bd79.js (polyfills) 59.6 kB [initial] [rendered]
chunk {3} main.90f87ba60061b2818da5.js (main) 208 kB [initial] [rendered]
Done in 20.90s.
so the whole app bundle size increased from 172K to 208K
from ts-cacheable.
@angelnikolov Can you please give me an example of using cacheResolver and cacheHasher and its difference,As i am using your package for my project,as of now not facing any issue while using other configurations except this two.
from ts-cacheable.
Related Issues (20)
- GlobalCacheConfig.storageStrategy not used in Angular 9? HOT 7
- Possibility to cache per instance HOT 7
- JSON parse type issues HOT 4
- Cache query params HOT 2
- Refresh data HOT 7
- invoking a function after maxAge ends HOT 1
- How to keep cache isolated between different users ? HOT 5
- inMemoryStorageStrategy: What is the in-memory size that can be utilized using the cacheable decorator? HOT 2
- Does this work with subscribe? HOT 1
- [@CacheBuster()][Feature Proposal] Instant cache busting HOT 3
- Caching for urls without parameters
- Adapt description about "Cache busting" when different parameters are used HOT 4
- Observable<XXXXXX>>' is not assignable to parameter of type 'TypedPropertyDescriptor<ICacheable<Observable<any>>>'. HOT 4
- Support for optional parameters HOT 2
- Question: Serve the cached response and get the latest data in background HOT 2
- Async storage strategies with observable @Cacheable decorator HOT 1
- globalCacheBusterNotifier not working when using PCacheable decorator HOT 2
- Question: How to set Storage Strategy at Global Level HOT 1
- Does Ts-Cachable support typed observables? HOT 4
- StorageStrategy - removeAtIndex add entity to parameters HOT 7
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 ts-cacheable.