-
-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[💡 FEATURE REQUEST]: Static HTTP middleware, immutable option. #1985
Comments
Hey @Warxcell 👋 |
I will try, but I don't have any experience with Go. 🤣 |
Sure, you may use a |
I'll help you on the review stage 😃 |
this is my progress so far, I have difficulties: how to scan rootDir for files, recursively? |
@Warxcell You may use |
Thanks! I think I'm ready, but no idea how to test it tho :D neither found tests for this middleware |
Plugin
HTTP Middleware (any)
I have an idea!
it would be cool if static HTTP middleware have option
immutable
- so when turned on - it would scan all files in root dir on startup and cache their properties in memory, so with that option roadrunner won't needStatic HTTP middleware slows down request processing by ~10% because RR has to check each request for the corresponding file.
thus enabling static http middleware, will have zero performance impact. Furthermore it can be used to send https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control immutable option.
Because some projects may run inside docker with read-only filesystem, so roadrunner can be 100% sure that files WON'T change after startup.
The text was updated successfully, but these errors were encountered: