NextJS Cache handler using SurrealDB as the backing store.
npm install nextjs-cache-handler-surrealdbtsmodule.exports = {
cacheHandler: require.resolve('nextjs-cache-handler-surrealdb'),
cacheMaxMemorySize: 0, // disable default in-memory caching
}
`$3
##### SURREALDB_URL
URL to connect to the SurrealDB instance.
##### SURREALDB_USERNAME
Username used to connect to the SurrealDB instance.
##### SURREALDB_PASSWORD
Password used to connect to the SurrealDB instance.
##### SURREALDB_SCOPE
Scope used to connect to the SurrealDB instance.
##### SURREALDB_NAMESPACE
Namespace to store the db in
##### SURREALDB_DATABASE
Database to store the table in
##### NEXT_SURREALDB_CACHE_TABLE
Specify the table name
##### NEXT_SURREALDB_CACHE_AUTO_SWEEP
Enable automatically clearing out expired entries. Defaults to true.
##### NEXT_SURREALDB_CACHE_AUTO_SWEEP_INTERVAL_MS
How much time to wait before clearing out expired entries in milliseconds. Defaults to 5 minutes.
##### NEXT_SURREALDB_CACHE_MAX_AGE_MS
Define a max time limit for entries in milliseconds. Defaults to 5 minutes. Set to -1 to disable.
$3
It may be necessary to increase the following environment variables for SurrealDB e.g. to 10mib
`sh
SURREAL_HTTP_MAX_RPC_BODY_SIZE='10 MiB'
SURREAL_HTTP_MAX_SQL_BODY_SIZE='10 MiB'
``