Make a ModelCache for each request #2
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Depends on
#16 Cleanup/deduplicate DB requests
ashpie/swaf
Reference: ashpie/swaf#2
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When retrieving models, if it exists in the cache (by id) then return the cached references instead.
For getById requests, or id IN (1, 2, 3...) requests, prefer returning directly from the cache if exists.
This is doable by using an
AsyncLocalStorage
.Also, it might be better to first try to cleanup DB requests (as in deduplicate) before doing that.