caching: fix diskcache implementation
This commit is contained in:
10
README.md
10
README.md
@@ -40,7 +40,7 @@ Some features of morss:
|
||||
- Follow 301/meta redirects
|
||||
- Recover xml feeds with corrupt encoding
|
||||
- Supports gzip-compressed http content
|
||||
- HTTP caching with 3 different backends (in-memory/sqlite/mysql)
|
||||
- HTTP caching with different backends (in-memory/sqlite/mysql/redis/diskcache)
|
||||
- Works as server/cli tool
|
||||
- Deobfuscate various tracking links
|
||||
|
||||
@@ -60,8 +60,8 @@ Full installation (including optional dependencies)
|
||||
pip install git+https://git.pictuga.com/pictuga/morss.git#[full]
|
||||
```
|
||||
|
||||
The full install includes mysql and redis (possible cache backends). Otherwise,
|
||||
only in-memory and sqlite3 caches are available.
|
||||
The full install includes mysql, redis and diskcache (possible cache backends).
|
||||
Otherwise, only in-memory and sqlite3 caches are available.
|
||||
|
||||
The dependency `lxml` is fairly long to install (especially on Raspberry Pi, as
|
||||
C code needs to be compiled). If possible on your distribution, try installing
|
||||
@@ -390,12 +390,14 @@ will be cleared every time the program is run). Path can be defined with
|
||||
environment variables: `MYSQL_USER`, `MYSQL_PWD`, `MYSQL_DB`, `MYSQL_HOST`
|
||||
- `CACHE=redis`: Redis cache. Connection can be defined with the following
|
||||
environment variables: `REDIS_HOST`, `REDIS_PORT`, `REDIS_DB`, `REDIS_PWD`
|
||||
- `CACHE=diskcache`: disk-based cache. Target directory canbe defined with
|
||||
`DISKCAHE_DIR`.
|
||||
|
||||
To limit the size of the cache:
|
||||
|
||||
- `CACHE_SIZE` sets the target number of items in the cache (further items will
|
||||
be deleted but the cache might be temporarily bigger than that). Defaults to 1k
|
||||
entries.
|
||||
entries. NB. When using `diskcache`, this is the cache max size in Bytes.
|
||||
- `CACHE_LIFESPAN` (seconds) sets how often the cache must be trimmed (i.e. cut
|
||||
down to the number of items set in `CACHE_SIZE`). Defaults to 1min.
|
||||
|
||||
|
Reference in New Issue
Block a user