Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bennn/with-cache
Simple, filesystem-based caching for Racket
https://github.com/bennn/with-cache
Last synced: about 2 months ago
JSON representation
Simple, filesystem-based caching for Racket
- Host: GitHub
- URL: https://github.com/bennn/with-cache
- Owner: bennn
- License: other
- Created: 2016-08-04T03:46:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-28T15:00:24.000Z (over 2 years ago)
- Last Synced: 2024-10-22T20:27:10.563Z (3 months ago)
- Language: Racket
- Size: 43.9 KB
- Stars: 17
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-racket-and-scheme - with-cache - based caching for Racket (Racket / Tools/lib)
README
with-cache
===
[![Build Status](https://travis-ci.org/bennn/with-cache.svg)](https://travis-ci.org/bennn/with-cache)
[![Coverage Status](https://coveralls.io/repos/bennn/with-cache/badge.svg?branch=master&service=github)](https://coveralls.io/github/bennn/with-cache?branch=master)
[![Scribble](https://img.shields.io/badge/Docs-Scribble-blue.svg)](http://docs.racket-lang.org/with-cache/index.html)Simple, filesystem-based caching.
0. Pick a directory to store caches in.
By default, it's the `./compiled/with-cache` directory.
1. Wrap "expensive" computations in a thunk, call the thunk via `with-cache`.
2. Results of the expensive computation are automatically stored and retrieved.Example:
```
(with-cache "fact42.rktd"
(λ () (factorial 42)))
(with-cache "pict.rktd"
(λ () (standard-fish 100 50))
#:read deserialize
#:write serialize)
```Install
---From the Racket [package server](pkgs.racket-lang.org):
```
$ raco pkg install with-cache
```From Github:
```
$ git clone https://github.com/bennn/with-cache
$ raco pkg install ./with-cache
```Don't forget the `./`!
More
---The real documentation is here:
http://docs.racket-lang.org/with-cache/index.htmland has instructions for:
- invalidating cachefiles
- changing the default cache directory
- cachefile naming conventions