https://kotlinlang.org logo
#apollo-kotlin
Title
# apollo-kotlin
f

Frank Sullivan

09/26/2023, 9:07 PM
Random question about normalized caching. We are using a custom cache key generator to do the typical
__typename
+
id
thing. However, not every object in the JSON tree has these properties, and so in that case the default is used (path to the object, basically). Has anyone tried / would it be a bad idea to hash this default key and use it instead? It seems like collisions should be very rare?
👀 1
The reason I ask is that this default cache key contains the query's params, which I think makes sense because different queries usually return different results. However, for us these cache keys can become very very long and the keys themselves take up a lot of space.
btw I'm more asking for advice about our custom cache key generator, not suggesting that this be the default behavior for the library or anything
m

mbonnin

09/26/2023, 9:19 PM
It's a fair observation. I'm not aware anything like that has ever been tried but sounds like it could be worth it
f

Frank Sullivan

09/26/2023, 9:27 PM
Cool I will give it a try, thanks
👍 1