simpler caching algorithm
* tekuti/cache.scm: Simpler LRU algorithm for the cache. Conses more, but throws away the cache less.
This commit is contained in:
parent
bc53abe0b6
commit
aa86b62d79
1 changed files with 5 additions and 4 deletions
|
@ -41,7 +41,8 @@
|
|||
(apply values (assoc-ref (cdr cache) (request-uri request))))
|
||||
|
||||
(define (cache-set cache master request . args)
|
||||
(append (if (and cache (< (length cache) 20))
|
||||
cache
|
||||
(list master))
|
||||
(acons (request-uri request) args '())))
|
||||
(cons* master
|
||||
(cons (request-uri request) args)
|
||||
(if (and cache (equal? (car cache) master))
|
||||
(list-head (cdr cache) 9)
|
||||
'())))
|
||||
|
|
Loading…
Reference in a new issue