Support "caching" in the Dark language #4673
StachuDotNet
started this conversation in
Suggestions
Replies: 1 comment 1 reply
-
Feels like a middleware? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have this vague idea of a user being able to wrap a fn call with a 'cache' construct (maybe a new Expr, not sure), similar visually/ergonomically to feature flags. You have some place of setting how the cache works (e.g. the results expire after [x] timing, or the results expire after [x] usages, no expiry, etc.).
For example, let's say you have HTTP handlers that return the same results for the same inputs, but would cost a fair amount of processing time if handled in-line. It'd be great for the HTTP handler's body to be all/largely wrapped up in a 'cache' construct (again, I imagine this vaguely feeling like a feature flag) such that after the first request, subsequent responses are fast, without the Dark user having to manually deal with caching.
If this isn't clear, I can try to Figma for a few minutes how I imagine it looking.
Beta Was this translation helpful? Give feedback.
All reactions