LiteFS + Caching #859
-
I was inspecting proxy:
...
db: '${DATABASE_FILENAME}' Here are some relevant links I found: I am guessing If for some reason I don't use LiteFS as my main database (use something else e.g., other hosted SQLite, Postgres, etc.), but still use LiteFS only for caching purposes, do I still need to keep this proxy:
...
db: '${CACHE_DATABASE_FILENAME}' Or is it safe to delete this |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The The cache is a bit different since we actually often update the cache on GET requests and we don't want to make the user have to go to the primary on those requests (it defeats the purpose of replicas) which is why we act as our own proxy with |
Beta Was this translation helpful? Give feedback.
The
proxy
is only necessary to solve consistency problem: https://github.com/fly-apps/litefs-jsThe cache is a bit different since we actually often update the cache on GET requests and we don't want to make the user have to go to the primary on those requests (it defeats the purpose of replicas) which is why we act as our own proxy with
updatePrimaryCacheValue
. So yes, you're correct, if you're not using litefs for your primary database you can delete the proxy config. Make sure you update your PORT in your Dockerfile to be 8080 since the litefs proxy server won't be listening on 8080 anymore.