Skip to content
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

Add support for serving precompressed static files from ServeFile #2

Open
suntong opened this issue May 20, 2020 · 4 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@suntong
Copy link

suntong commented May 20, 2020

Thanks for providing this useful middleware first of all. I'm wondering if the Static files from http.ServeFile method is also supported. Especially,

It would also be 'nice to have' if the http.ServeFile method would check for the presence of xxx.gz and serve it if present and the accept header includes gzip. This is a trick that nginx does and it greatly accelerates the serving of static css, js etc files because they can be compressed just once during the build process. There's the added benefit too that they are smaller files to read, as well as needing fewer bytes on the wire

thanks

@nanmu42
Copy link
Owner

nanmu42 commented May 21, 2020

Yes, I had this thought, that would be neat.

Need to figure out how to implement this.

Thanks for your advice.

@nanmu42 nanmu42 added the help wanted Extra attention is needed label May 21, 2020
@nanmu42 nanmu42 changed the title Static files from ServeFile Serve precompressed static files from ServeFile May 21, 2020
@nanmu42 nanmu42 changed the title Serve precompressed static files from ServeFile Add support for serving precompressed static files from ServeFile May 21, 2020
@nanmu42 nanmu42 added the enhancement New feature or request label May 21, 2020
@kashid16
Copy link

kashid16 commented Sep 7, 2020

Any update on this?

@nanmu42
Copy link
Owner

nanmu42 commented Nov 28, 2020

The FS and embed package is about to land in Go 1.16.

This may be a good news for this long-desired feature.

@bddjr
Copy link

bddjr commented Sep 26, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants