-
Notifications
You must be signed in to change notification settings - Fork 210
Description
- I have looked for existing issues (including closed) about this
Feature Request
Motivation
I'm using nix and because of nix quirk all files have last modified date of 1970. This is technically correct as the files are unchanged - server upon restart changes directory from which files are served. However this has side-effect of always having last modified date of 1970 and thus never refetched by browser.
I tried to append last modified header in axum but this just caused duplicate headers and did not resolve the problem.
On non-nix deployments it may be caused when kubernets are spinned for example during update. The last modified date is date when file was created so when container was create. This may be much earlier than when container is actually deployed causing a stale files being served from browser cache.
Proposal
Add a configuration option to ServeDir to be able to configure the behaviour (etag only, last-modified must be never older than axum start date etc.)