staticPlugin caches files on startup and does not refresh when new files are added (Docker environment) #1393
Unanswered
goodlythink
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
When using staticPlugin in ElysiaJS inside a Docker container, the plugin seems to cache the file list at startup.
If new files are uploaded after the container has started, they cannot be accessed — the server responds with NOT_FOUND.
This issue does not happen in local development (non-Docker).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Files added after container startup should be served immediately without requiring a container rebuild or restart.
Current workaround
I wrote a custom middleware to serve files manually, but I’d like to know if staticPlugin has:
Environment (please complete the following information):
ElysiaJS version: 1.3.6
@elysiajs/static: 1.3.0
Docker base image: [FROM oven/bun AS build, FROM gcr.io/distroless/base ] from elysiajs web
Host OS: [AlmaLinux]
Additional context
This issue only occurs in Docker.
On localhost (dev mode), new files are served correctly without restarting.
`
import { Elysia } from 'elysia'
import { staticPlugin } from '@elysiajs/static'
const app = new Elysia()
.use(staticPlugin({
prefix: '/public',
assets: '/app/public'
}))
.listen(4000)
`
Beta Was this translation helpful? Give feedback.
All reactions