The LOCAL_FILES strategy stores cached data as files on disk using SHA256-hashed filenames. The cache survives restarts without any external dependencies. It supports TTL-based expiration and optional compression (GZIP or BROTLI).
This is a good choice for single-instance deployments where you want persistent cache without running Redis.
gothicRoutes. Setup (router, gothicRoutes. AppConfig {
CacheStrategy: gothicRoutes. LOCAL_FILES ,
ServeStaticFiles: gothicRoutes. ALL_ENVS ,
CacheConfig: &gothicRoutes. CacheConfig {
CacheFilesPath: ".gothic-cache" ,
},
}, routes.RegisterFileBasedRoutes) The CacheFilesPath field sets the directory where cache files are stored. It defaults to .gothic-cache if not specified. You can also enable Compression to reduce disk usage, choosing between GZIP (default) and BROTLI.
Now that you understand all the cache strategies, learn how to create JSON endpoints for external clients with API Routes!