Caching - global or vertex only? And what to cache?
by Ondrej Zizka
Hi team,
regarding graph REST HTTP requests caching - should it be global or
rather per-vertex (per-model)?
I started coding a global solution. If another model needs the same
data, it will request from the same URL. I see no reason not to return
the same object.
Another question is what to cache. Due to how it's currently done, the
getter is supposed to return Observable<...Model>. There are these options:
1) To cache an Observable which will wrap HTTP Observable. I don't know
yet whether this will cause re-sending HTTP request for another
subscriber. It will solve the Angular's change scanning, though, which
is the bigger problem. Also, RxJS's cache() operator could be used to
cache the HTTP response internally.
2) It can also resolve the Observable chain, and store the result into
the cache asynchronously.
So - when Angular would ask soon after, it would result in another
request (maybe?); when called later, it would return the already
available cached result.
This would reduce the HTTP requests, but would not necessarily
solve the Angular change scanning.
3) A combination of 1) and 2), which would cache
* the Observables from 1) internally, so that the getter gets the
same object each time,
* the results from 2) so that the subsequent requests to the same
URL don't generate another HTTP request, with some timeout so the page
won't get staled.
This one is a bit complicated but I think with some RxJS magic it
can be done.
Ondra
--
--
Ondrej Zizka, Windup project, Brno
8 years, 1 month
[WARNING] Windup-web master branch switched NPM with YARN
by Marek Novotny
FYI
-------- Forwarded Message --------
Subject: [WARNING] Windup-web master branch switched NPM with YARN
Date: Mon, 5 Dec 2016 10:56:56 +0100
From: Marek Novotny <mnovotny(a)redhat.com>
Reply-To: mnovotny(a)redhat.com
Organization: Redhat
To: windup-eng(a)redhat.com
I merged the PR to use Yarn package manager from David and from now you need to use YARN instead of NPM
Run
npm install -g phantomjs-prebuilt
and
npm install -g yarn
Instructions are updated in windup-web root README.md too.
--
Marek Novotny
--
Windup team member
Red Hat Czech s.r.o.
Purkynova 99
612 45 Brno
8 years, 1 month