Skip to content

Commit af2a74b

Browse files
committed
convert README into basic docs site
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
1 parent 5e838c7 commit af2a74b

File tree

11 files changed

+506
-16
lines changed

11 files changed

+506
-16
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to the FastAPI Template
1+
# Contributing to the Project
22

33
Thank you for your interest in contributing to `fastapi-redis-cache-reborn`! We
44
welcome all contributions, big or small.

TODO.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# TODO List
22

3+
## Existing Issues
4+
35
These below are from Issues or PRs in the original repository.
46

57
- Add ability to manually expire a cache entry
@@ -8,6 +10,9 @@ These below are from Issues or PRs in the original repository.
810
(<https://github.com/a-luna/fastapi-redis-cache/pull/66>)
911
- Take a look at other issues in the original repository to see if any need to
1012
be added here.
13+
14+
## New Ideas
15+
1116
- add an option to the init function to disable logging of cache hits and
1217
misses. or only display these messages if a certain ENV variable is set/unset?
1318
- add an option to have a separate logging file for cache hits and misses?

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "CHANGELOG.md"

docs/contributing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "CONTRIBUTING.md"

docs/index.md

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,39 @@
1-
# Welcome to MkDocs
1+
# FastAPI-Redis-Cache-Reborn
22

3-
For full documentation visit [mkdocs.org](https://www.mkdocs.org).
3+
## Introduction
44

5-
## Commands
5+
A simple and robust caching solution for FastAPI that interprets request header
6+
values and creates proper response header values (powered by Redis)
67

7-
* `mkdocs new [dir-name]` - Create a new project.
8-
* `mkdocs serve` - Start the live-reloading docs server.
9-
* `mkdocs build` - Build the documentation site.
10-
* `mkdocs -h` - Print help message and exit.
8+
This project is a continuation of
9+
[fastapi-redis-cache](https://github.com/a-luna/fastapi-redis-cache){:target="_blank"}
10+
which seems to no longer be maintained and had fallen behind in both Redis and
11+
FastAPI versions. I decided to split this as a separate repository rather than a
12+
fork, since the original project has had no activity for a over three years.
1113

12-
## Project layout
14+
Right now the code is basically the same as the original project, but I have
15+
updated the Package management system to use Poetry, the dependencies and the
16+
CI/CD pipeline, and added type-hinting. I've also merged some open PRs from the
17+
original project that fixed some issues.
1318

14-
mkdocs.yml # The configuration file.
15-
docs/
16-
index.md # The documentation homepage.
17-
... # Other markdown pages, images and other files.
19+
See the TODO File file for a list of things I plan to do in the near future.
20+
21+
The package still has the same interface and classes as the original. You will
22+
still import the package as `fastapi_redis_cache` in your code, the name has only
23+
changed on PyPI to avoid conflicts with the original package. This is to make it
24+
transparent to migrate to this version.
25+
26+
!!! warning "Important"
27+
It is important to make sure that the old package is uninstalled before
28+
installing this one. The package name has changed, but the module name is
29+
still `fastapi_redis_cache`. **The best way is to remove your old virtual
30+
environment and run `poetry install` or `pip install` again**.
31+
32+
## Features
33+
34+
- Cache response data for async and non-async path operation functions.
35+
- Lifetime of cached data is configured separately for each API endpoint.
36+
- Requests with `Cache-Control` header containing `no-cache` or `no-store` are
37+
handled correctly (all caching behavior is disabled).
38+
- Requests with `If-None-Match` header will receive a response with status `304 NOT
39+
MODIFIED` if ETag for requested resource matches header value.

docs/installation.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Installation
2+
3+
To add `fastapi-redis-cache-reborn` to your project, you can use `poetry` or
4+
`pip`.
5+
6+
if you are using `poetry` (recommended):
7+
8+
```bash
9+
poetry add fastapi-redis-cache-reborn
10+
```
11+
12+
Otherwise you can use `pip`:
13+
14+
```bash
15+
pip install fastapi-redis-cache-reborn
16+
```

docs/license.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
```
3+
--8<-- "LICENSE"
4+
```

docs/todo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "TODO.md"

0 commit comments

Comments
 (0)