mirror of
https://github.com/penpot/penpot.git
synced 2026-10-30 06:20:32 +00:00
⚡ Keep the summary cache for a working day, not ten minutes
The fetch the cache exists for is a file open, and expireAfterAccess of ten minutes threw the entry away between two sessions on the same file: a listing measured at 5 ms was 26 s again fifteen minutes later. An entry is a uuid and five numbers, so the window costs nothing.
This commit is contained in:
parent
48f2f4c55f
commit
b6232edfd5
@ -452,8 +452,13 @@
|
||||
`(base-snapshot-id, source-revn, branch-revn)` — exactly the inputs the
|
||||
computation reads. A stale key is a cache miss, and a cache miss is the
|
||||
old behaviour, so the cache needs no invalidation logic; `keepalive`
|
||||
and `max-size` bound memory, they never decide correctness."
|
||||
(ucache/create :max-size 2048 :keepalive "10m"))
|
||||
and `max-size` bound memory, they never decide correctness.
|
||||
|
||||
The window is a working day rather than minutes because the fetch this
|
||||
exists for is a file open: an entry is a uuid and five numbers, so
|
||||
keeping it costs nothing, and a shorter window pays the whole cold cost
|
||||
again for a designer who comes back after lunch."
|
||||
(ucache/create :max-size 8192 :keepalive "8h"))
|
||||
|
||||
(defn- summary-cache-key
|
||||
[{:keys [base-snapshot-id source-revn branch-revn]}]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user