š Iām building a fullstack webapp in clojure for the first time, without much prior experience doing this at all. Iām using http://htmx.org to avoid writing frontend JS (if youāre unfamiliar, itās just rendering everything server-side and swapping only certain divs instead of fullpage refresh). For some use-cases I need to know what the user is seeing e.g. āpress button to go to next itemā -> I need to know where the user is and whatās next. I think this is usually done with sessions, but Iām not sure in practice how to keep track of this and more complicated things like cacheing full hiccup objects. My understanding is that itās possible to use the ring cookie from the session middleware and then reply to the client with the information I want to keep track. This sounds ok for some data points, but full page status is too much no? I also read about using redis to keep the session, but donāt I still have to send the whole state to the client every time? I felt the ring-sessions docs is a bit thin for beginners like me š¬
I may have misunderstood but it seems to me that where the user is and whatās next could be represented by the url, no?
where the user is yes, but Iām not seeing how to do whatās next in the url. For context thereās the possibility that āwhatās nextā is composed of 100+ uuids. Isnāt that too much? I think I have found a good solution totally bypassing sessions though š using htmx I can just create a button with the url pointing at the next/previous item to the current one, because the server always knows what is available. A bit hard to explain in pure english. Nonetheless, Iām still interested in answering this question about sending data to the client with every request
Would something like /friends?cursor=some-uuid&count=100 work?