Cache expiration recommendations
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- go
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
Start by reviewing fastcache's cache API and the expiration approach described in this issue, focusing on whether keys can be iterated or removed by expiration. Done means establishing a documented, agreed recommendation or implementation path for scheduled cleanup without an unsynchronized duplicate key index.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
It is easy to implement cache expiration on top of fastcache by caching values with marshaled deadlines and verifying deadlines after reading these values from the cache.
While I completely agree with this statement, this only handles "cache hit" expiration. How would you recommend implementing a scheduler, that cleans up the cache once in a while?
The main issue is that I don't see a way to "iterate over all cache keys", neither a way to "delete all by value" (e.g. by expiration) in order to implement this.
Currently, it seems that the only possible way to achieve this is by creating an additional data structure (e.g. thread-safe map[string]int with tokenKey -> expirationVal or reversed, map[int][]string with expirationKey -> []tokenVal) in order to have some sort of iteration over keys / expirations.
However, this adds extra complexity (has to be kept in sync, so basically holding a cache for another cache) and memory (duplicating the keys), especially in cases with large keys (I'm using ~1000 char JWTs as keys, no need for value in this scenario, just expiration, which is usually quite big, e.g up to 24 hours).
@valyala Looking forward to hear you take on this, I would really like to use fastcache in our products.
- Ngôn ngữ chính
- Go
- Star
- 2.4k
- Fork
- 199
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của VictoriaMetrics/fastcache
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
VictoriaMetrics/fastcache#98 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
VictoriaMetrics/fastcache#80 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
VictoriaMetrics/fastcache#79 · 1 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
VictoriaMetrics/fastcache#75 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
VictoriaMetrics/fastcache#74 ·
Tất cả issue của VictoriaMetrics/fastcache
Issue tương tự
-
A failed hydrate call can be dropped when the row's wait is ready tooCó thể đã có người làm @turbot-agent-fleet đã nhận hôm nay. Đang mởagent:ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
turbot/steampipe-plugin-sdk#1018 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement needs-review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
router-for-me/CLIProxyAPI#7976 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
uselagoon/lagoon-cli#501 · 1 reaction ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100