Skip to content

Commit ee0a27a

Browse files
committed
Update readme
1 parent 76e502b commit ee0a27a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# Using the service
1515

16-
This service provides a stale while revalidate cache for your HTTP requests. If a request is made to a URL that is already in the cache, the cache will be used. The cache will also be used if the cache is stale. However, an asynchronous request will be made to the server to refresh the cache if the cache is stale.
16+
This service provides a stale while revalidate cache for your HTTP requests. If a request is made to a URL that is already in the cache, the cache will be used. The cache will also be used if the cache is stale. However, an asynchronous request will be made to the server to refresh the cache.
1717

1818
Check out the `dev.env` file for configuration options.
1919

@@ -22,11 +22,14 @@ Essentially you can choose between in-memory or redis persistence.
2222
Redis persistence is recommended when you have multiple processes running the service (or multiple pods).
2323

2424

25-
The environment variable CACHE_IGNORE_ENDPOINTS defines the endpoints that are allowed to passthrough without any checks from this service.
25+
The environment variable CACHE_IGNORE_ENDPOINTS defines the endpoints that are allowed to passthrough without any caching.
2626

2727
You can also choose to incude query parameters in the cache key. `CACHE_SHOULD_HASH_QUERY` is a boolean flag that defines whether or not to hash the query parameters.
2828

29-
By `CACHE_HASH_QUERY_IGNORE` you can define which query parameters should be ignored when hashing the query.
29+
For example if you have a request to `/api/v1/users?id=1` and `CACHE_SHOULD_HASH_QUERY` is set to `true`, the cache key will be `/api/v1/users?id=1`. If `CACHE_SHOULD_HASH_QUERY` is set to `false`, the cache key will be `/api/v1/users`.
30+
31+
You can also configure `CACHE_HASH_QUERY_IGNORE` to ignore certain query parameters from the cache key. For example if you have a request to `/api/v1/users?id=1&utm=1` and `CACHE_HASH_QUERY_IGNORE=utm` the cache key will be `/api/v1/users?id=1`.
32+
3033

3134
Another useful configuration option is `CACHE_STALE_WHILE_REVALIDATE_SEC`. This defines the time in seconds that the cache entry is considered stale and the cache is revalidated asynchronously.
3235

0 commit comments

Comments
 (0)