Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Rails Action Cache with Hypernova #122

Open
gbateman opened this issue May 22, 2018 · 3 comments
Open

Rails Action Cache with Hypernova #122

gbateman opened this issue May 22, 2018 · 3 comments

Comments

@gbateman
Copy link

gbateman commented May 22, 2018

I was trying to implement action caching using actionpack-action_caching but because of how hypernova works with render tokens, the cached result is just the render token. Furthermore, it is clearly useless to call the after action after returning such a result, because there were no calls to render_react_component if the result was cached. It would be nice if there was a supported way to enable caching on hypernova rendered components.

Currently I am storing the results of @hypernova_batch.submit! in the rails cache and then manually replacing the batch tokens from the cached results in an after action, but this method is not easy to abstract, and feels unclean.

@ljharb
Copy link
Collaborator

ljharb commented May 23, 2018

I'm not familiar with how action caching works, but I'd assume it would need to run after all filters - and hypernova runs in an around_filter. If it's not doing that, then it's probably caching the wrong thing in a number of cases.

@gbateman
Copy link
Author

Yeah, it seems like action caching takes the result from before after_filters though - not what hypernova could do to get around that if anything

@ljharb
Copy link
Collaborator

ljharb commented May 23, 2018

I don't think there's anything; it seems like a flaw/bug in action cache, tbh.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants