nextjournal

2022-02-19T11:56:02.151689Z

@mkvlr Which use-case do you have in mind for the "persistent cache" functionality ? From my experience it seems to be "very difficult" to guarantee that all forms get persistent successfully via nippy. -> (most ???) things will therfore be re-evaluated after JVM restart one-time (and then they are in the in-memory cache), as most forms depend on each other in some way.

mkvlr 2022-02-19T12:10:14.628019Z

anything that takes more than a few seconds to run. The ease or difficulty of this is largely context dependent I think. When you build up data structures or indices out of pure clojure data as is the case with most code weโ€™re writing this works like a charm.

2022-02-19T16:44:05.579179Z

Yes, I changed my "result type" of my model training to be "pure data" (without functions). And now the persistent caching works as expected.

2022-02-19T13:38:47.556769Z

Yes, indeed, you are right. But "pure data" is then a kind of "key requirement" of the persistent caching. My current use case is "99% pure data" (with 2 functions deep inside the pure data) -> I will try as well to re-think my use case for ways to remove the 2 functions. I think it is important to have logging which explains "what failed to get cached".

2022-02-19T13:52:16.087439Z

Can we have this as a top level function in Clerk ? Like "clear-in-memory-cache!" ?

(reset! webserver/!doc {})

2022-02-19T13:54:40.568679Z

and maybe rename clear-cache to clear-persistent-cache ? So to communicate the 2 layers of caching and a clean way to clear both.

mkvlr 2022-02-19T13:58:35.839119Z

clear-cache! should just wipe the in memory cache as well I think

โž• 1
2022-02-19T14:00:16.098769Z

yes, maybe.

2022-02-19T14:00:30.231479Z

Not sure, if we need to differenciate.

2022-02-19T14:00:59.707079Z

Probably it should do both, just meaning "clear it all !"

๐Ÿ‘ 1
mkvlr 2022-02-19T17:07:09.449839Z

https://github.com/nextjournal/clerk/pull/86

2022-02-19T17:56:30.159269Z

Beautifull !!

2022-02-19T18:41:07.959159Z

I am a complete newby in Clojurescript. But if you tell me how to translate this:

$('#example').DataTable( {
    data: data
} );
into a "viewer", then I can maybe figure out the rest. And trying to adapt your example into other javascript libraries.