Cache expiration recommendations
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- go
- Área
- backend, performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 2.4k
- Forks
- 199
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de VictoriaMetrics/fastcache
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
VictoriaMetrics/fastcache#98 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
VictoriaMetrics/fastcache#80 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
VictoriaMetrics/fastcache#79 · 1 comentario · 1 reacción ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 30/100
VictoriaMetrics/fastcache#75 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
VictoriaMetrics/fastcache#74 ·
Todos los issues de VictoriaMetrics/fastcache
Issues similares
-
A failed hydrate call can be dropped when the row's wait is ready tooPosiblemente ocupada @turbot-agent-fleet la tomó hoy. Abiertoagent:ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
turbot/steampipe-plugin-sdk#1018 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement needs-review
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
router-for-me/CLIProxyAPI#7976 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
uselagoon/lagoon-cli#501 · 1 reacción ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100