So playing a bit with Catacumba, how would one go for implementing something like etags? Just calculate in the ending handler and add to response? Guess there is no way to hook in a function after the ending handler on the “way back”? Or am I missing something?
hi @kardan
Just yesterday I have thought about that
I want implement http cache mechanism in my app and I found the same issue
I don’t need it at the moment, was mostly trying to chew on the model a bit
Implement if-modified-since mechanism is pretty easy
but the etag seems like a little bit difficult
I think ratpack does not provides any way to do it, but I think we can do it at catacumba level
let [resp (do stuff) etag (calculate-etag resp)] (http/ok resp {:etag etag}) ?
yes, but this only calculates the etag, we also need a mechainism for "no send the response in case of request etag matches the response etag
ah, yes
At this moment it is not possible implement, but I'm thinking on it. I would like to have it plugable
in the same way as I also working on content-negotiation
ok, cool to know.
Ratpack provides a beforeSend handler but I think it does not allows overwrite the body
I think I can make a feature proposal for allow overwrite the body on that hook
Well as I said. I don’t really have a usecase for etags. What I build is really early at this point
I don’t have a problem witch cache and etags - but I hope I’ll get one :simple_smile:
😉
👍