avram icon indicating copy to clipboard operation
avram copied to clipboard

Cache pollution across requests in development

Open robacarp opened this issue 3 years ago • 1 comments

I'm seeing cache objects bleed over between requests on Avram release v0.22.0 with query cache enabled. This might be related to #803. I disabled turbolinks to validate there was nothing strange happening on the front end, but the issue persists.

I don't have a lot of clever code going on. It's a server rendered page, traditional form submits, etc. Nothing fancy.

This sequence repeatedly produces ghost artifacts:

GET resource/:id/subresource_index DELETE subresource/:id -> 301 redirect to resource/:id/subresource_index GET resource/:id/subresource_index

To be a little more concrete: GET posts/:id/comments DELETE comment/:id -> 301 redirect to posts/:id/comments GET posts/:id/comments

The second index fetch will reliably still have the deleted comment. Frequently the comment persists until the server recompiles.

robacarp avatar Jan 28 '22 23:01 robacarp

It turns out that there's a few different cases when a Fiber can leak across requests. What Athena does is sets a new instance on the current fiber within an HTTP handler https://github.com/athena-framework/athena/blob/master/src/components/framework/src/athena.cr#L152-L153

I think we will need to do something similar.

jwoertink avatar Feb 12 '22 19:02 jwoertink