Open jperelli opened 4 years ago
as in - caching the binary images? If so, this will probably need an expires param as well
Right, caching the binary images using the params (or hash of params) as key of the cache. That way only the first time the image is generated, but the next times is requested, the library just uses the cache to get and return the image fast.
And yes, I'll add an expires or timeout param for it to be auto purged
Think on how to add a directory/redis/memcache cache so that this can be used as a
<img src="...">
tag more efficiently. Maybe add a cache param likecache_force_refresh=true
to refresh cache, or a timeout likecache_timeout
to expire old elements saved in cachethis module looks good enough https://www.npmjs.com/package/cache-manager and this one to build the key from the options object https://www.npmjs.com/package/json-stable-stringify