[metrics-team] Cache advice for Onionoo Node.js API client

Luke Childs lukechilds123 at gmail.com
Sun Dec 18 13:33:21 UTC 2016


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Karsten,

Thanks for getting back to me :)

> That sounds correct, assuming you have enough memory to really store
> responses indefinitely.  Realistically, you could safely discard them
> after an hour or even sooner.

Thanks for confirming. Re memory, I've set a configurable limit (defaults
to 500) on how many responses can be simultaneously cached. Once the limit
is exceeded the oldest entries will be dropped so eating memory shouldn't
be an issue.

> But I'm more worried of
> thousands of mobile clients each making a handful of requests than a
> server caching responses a little less long than it could.

The issue is the other way round, I'm currently holding the cache longer
than I should because it always returns a max-age of 300. Not really a huge
issue for Tor Explorer but if someone builds some sort of analytics script
with this module I don't want to be providing out of date data. Just wanted
to confirm the header values mean what I think they mean, my web searches
returned relatively little info.

> I guess my advice, except for the attempts to answer your questions
> above, is not to over-engineer the client-side cache for this Node.js
> module.

But over-engineering is fun and I have unlimited time :)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJYVpAVAAoJEJPWEqnWHCgaUwoH/ikcPW0wKKXQ2rwMEVKXjmBy
Zcyp8SHkCyg3TPlTRUkqoUyxoiw8Ox57vjRGDx3lv20c+UZD9AwSsOMHaCEsg3Kp
kt6a3rpS6qvYGQyqAMki6Ks4f6VCnAEhm2NoFUUrceHzZ04JQjz8++HrbGZG6/ig
82Yzb/JUa+v+VTRH86nPRhiO9vPKPbW3HKZSADSYYYT0fusd0Qxm4tpyhicsiGBj
RXcqY4nTVCBEWHqJNT1Uf/Cyk0C4TCwDKP130DT2jCYqwjk/UyP1AM7wOVmA9boN
CxitRDSrwAHSmKsyfYnSuiWSMZNHGJy5onUgkxzMiXgv2MI9s/k1NA8nqwes5Mw=
=+Ka9
-----END PGP SIGNATURE-----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/metrics-team/attachments/20161218/601dcfd7/attachment.html>


More information about the metrics-team mailing list